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
Many of "Roles" hooks don't work #360
Comments
Same goes for the Permissions class actually. I haven't checked all the direct and inherited methods, but I checked "add" and it doesn't work, but "deleted" does. |
I'm not really sure what to do about those hooks because they are of pretty limited use. I'm thinking maybe I should just remove or deprecate them. That's because in order for some of them to get called (like those you mentioned, except for added), the method call has to originate on |
If they are problematic then I agree they should be removed - the Pages:: versions will be just fine. |
Users::added does not work either @ryancramerdesign |
@ryancramerdesign Bumping for consideration. |
…eprecated to fully functional per processwire/processwire-issues#360
I had previously made these hooks deprecated. But after @netcarver 's bump, I revisited this and decided to go in the opposite direction and instead make the hooks fully functional in all situations. Rather than only being called if the class name matches what it's supposed to be, the hooks will be called if the template is one that is valid for the type. This ensures they will be called in the situations where they might not have been previously. |
Great, thanks Ryan! |
Awesome to have these working! I just tested a few and they seem to be working as expected! |
Short description of the issue
Most of the Roles hooks don't work
These work
Roles::deleteReady
Roles::deleted
Roles::saveReady
Roles::saved
but these don't work
Roles::add
Roles::delete
Roles::save
Roles::added
Expected behavior
They should work :)
Actual behavior
They don't work :) :)
Steps to reproduce the issue
Add this to ready.php and then create a new role.
Nothing will appear in the log file.
This has been confirmed by others: https://processwire.com/talk/topic/17087-roles-hooks-not-working/
Setup/Environment
The text was updated successfully, but these errors were encountered: