-
Notifications
You must be signed in to change notification settings - Fork 23
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
Undefined variable $user (RestrictionService.php line 658) #125
Comments
@charlyecho can you show me what your custom mutation is doing? |
Hi James,
|
Hey, I'm having a similar issue: I'm calling a regular save_[section]_[entryType]_Entry mutation which should post some asset ids into an assets field. Many of the assets in the system don't have an uploader id as they were indexed from a remote source (AWS). The mutation will add these assets to the field fine, but if there is an uploader id set on the asset (they were uploaded via the craft cp) The mutation fails because of the same 'Undefined variable $user' as above (RestrictionService.php:658). Having tinkered with permissions/validation settings (Craft, Your plugin, The asset field) for some days I still can't find a solution so assuming it's a bug. Could you take a look? |
@robinbeatty thanks for your PR! I've added your fix to the private entry checks, too. Will release this in an update shortly. |
Released in 2.5.0! |
Hi James,
we have an issue on our project.
we call a custom mutation from a module with no authentication token (because it is a public mutation allowed to anyone).
In the code, restrictionService from line 654 to line 666, the code assume $user is defined, but the $user is defined only if tokenService->getHeaderToken() condition is true.
Can you fix this ?
I suggest moving line 654 to line 666 inside the getHeaderToken condition or checking $user is defined.
Regards
The text was updated successfully, but these errors were encountered: