Skip to content

Conversation

vHeemstra
Copy link

PDO's getDefaultScope not returning the client's (default) scope
When getting the default scope from the database using PDO, the getDefaultScope function neglects the $client_id provided, instead of returning the client's scope from the client table.

So I added that using the getClientScope function. Now it returns either default scopes set to client from client table or returns global default scopes from scope table.

I'm not sure if this should also be changed in other storage classes.

Return either default scopes set to client from client table or return global default scopes from scope table
$clientScope = $this->getClientScope($client_id);
if (!is_null($clientScope)) {
$getGlobalDefaults = false;
$defaultScopes = explode(' ', trim($clientScope));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's return $clientScopes here and remove the $getGlobalDefaults variable all together. This will greatly simplify this function.

@bshaffer
Copy link
Owner

We also need test coverage for this. Are you willing to add this? It will also verify if this issue is happening in the other storage classes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants