-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
onAdminSave($event) passes page as $event['object'] or $event['page'] depending on regular/flex page #2995
Comments
For Flex Pages it should be the same, yes (which looks like to be a bug), but the event passes object variable in the older version, too, so you need to check if you're saving a page or not. |
Yes, the type of object passed into eventhandler is being checked. Current workaround:
|
The bug is that they should both send the page as ['page'] on the event, however now it’s sent as PageInterface and that can be used the same for regular pages or flex. Should not be ['object'] |
…ge']` instead of `$event['object']` [#2995]
@rhukster Looks like there are a lot of inconsistencies in how the admin deals with the page events. All the other events use page instead of object. |
I updated the other events to use |
Thanks @mahagr 👍 |
When subscribing to onAdminSave event, a different Event object is passed when saving a 'regular' page versus a 'flex' page.
regular: $event['object']
flex: $event['page']
This will break plugins that want to intercept the saving of a page.
The text was updated successfully, but these errors were encountered: