Closed HLeithner closed 4 years ago
Unless something changed in core, doesn't this effectively disable the plugin on every view except the single article view? Since the dataset passed to the event in multi-item views excludes the "catid" property.
Category view at least triggers the event per item. But will check later.
I remember when I wrote the code this was based off of all those years ago that the article object that was getting to these events from the category views was missing fields, hence the whole "overload $article
with the database info" bit. Maybe that's changed since this was originally written, which would be good, but there was a reason it was done this way and I can't say I remember it with 100% certainty anymore (it's based on something I originally wrote in 2011).
If the onContentAfterTitle event is called from the category blog/list layout the plugin override category object (Joomla\CMS\Categories\CategoryNode) with a stdClass. This leads to an exception in the later in the layout the permissions for 'access-create' is checked.
That was the reason for the revert https://github.com/joomla/joomla-cms/pull/28740 before Joomla 3.9.17 release.