Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change PDO.php #709

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Change PDO.php #709

wants to merge 1 commit into from

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