I need to know if an entry is being saved via the bulk edit or the sequential edit actions, but I looked through the POST array and the data provided by the after_channel_entry_save hook and didn’t see anything to tell me what action was calling the hook.
In Publisher, if the user is editing a non-default language in the normal publish page, it sets the language in the CP to that non-default language, so the next time they edit an entry they immediately get the same language. However, if they then go to the edit entry list page and try to perform some bulk actions the language is still set to the non-default language, which then causes the bulk actions to potentially mess up data b/c its saving the default language (what the bulk edit forms default to, which is fine) over top of the non-default b/c Publisher’s cookie is still set to the non-default language.
It’s not great, but you might have to look at the URI/query string. Bulk edit should be triggering the save by hitting /cp/publish/bulk-edit/save
and sequential edit should have entry_ids
and modal_form=y
in the query string. I doubt these things would change any time soon. Otherwise, the hook is neatly abstracted to the model which doesn’t know anything about the UI, so it’s difficult and also kind of undesirable to pass UI state through to that level currently.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.