Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[Batch] Change State: pass only affected items to table and event #22851
Summary of Changes
When you currently change the state of items (published, unpublished, trashed...)in the list via inline or toolbar button, joomla does not care about the current state of the item.
This affects the notification (x items published...) and more importantly it also affects the primary keys that are passed to the onContentChangeState event (it passes all primary keys of all selected items including the ones where the state did not change). A plugin that listens to this event has no possibility to check if i.e. an article was unpublished before, because the value in db already changed.
After these changes we pass only the pks that really should be/changed to the table and plugin event. If there are no items to change, we respond with a success message "0 items published".
Because we already load the item, no additional query is needed.
Go to article Manager, set one article as unpublished.
As the change was made in ArticleModel this will affect all Models in the backend, that are extending it. So it would be good to test other entities as well.
When no items were published:
1 similar comment