User tests: Successful: Unsuccessful:
Pull Request for Issue #41086.
content.prepare
is now only called if the module configuration has "show introtext" set to "Yes". This is similar to mod_articles_category:
mod_articles_news
module to any positionContent is always content.prepare
d, even if the introtext is not displayed. Anything that is changed by content plugins besides the content (e.g. added scripts and stylesheets) is contained in the frontend HTML code (and might have side effects...)
Content is only content.prepare
d if it is actually selected to be shown. Anything that is changed by content plugins besides the content (e.g. added scripts and stylesheets) is NOT contained in the frontend HTML code.
Please select:
Documentation link for docs.joomla.org:
No documentation changes for docs.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
Category | ⇒ | Modules Front End |
Status | New | ⇒ | Pending |
This option currently does not control the onContentPrepare
event. Yes, the event is mentioned in the code of the module helper, but I'm not even sure what this does at this point. Before triggering the event in line 170, the text
is reset to ''
, and content plugins usually work on text
...
But currently onContentPrepare
is also called by HTMLHelper::_('content.prepare, ...)
on the introtext, even if $triggerEvents
is false. This is the issue that I'm trying to fix here.
The question remains if the content.prepare
on the introtext should be called if $triggerEvents
is true, or if the introtext is actually shown, or even both?
I would even go one step further and also check if the introtext is not empty.
For now just here and then we can see if we want to expand to other modules.
Labels |
Added:
?
PR-4.4-dev
|
As already said by hannes, I'm also not happy to run this event optional. You don't know if not a plugin fills it without using the existing content.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-09-08 08:59:54 |
Closed_By | ⇒ | laoneo | |
Labels |
Removed:
?
|
Thanks @ManuelHu for the pr. Unfortunately we don't really know the side effects it can have when we trigger the event based on the params, even when the intro text is empty. From a first glance the changes should be obvious, but the impact it can have on existing extensions is too risky. So I'm closing this pr. Thanks for understanding.
There is already an option for this.
joomla-cms/modules/mod_articles_news/src/Helper/ArticlesNewsHelper.php
Lines 168 to 183 in 507922c
??