Skip to content

[5.4] onContentPrepare in mod_articles#47467

Merged
muhme merged 4 commits intojoomla:5.4-devfrom
chmst:54-mod-articles-content-prepare
Apr 1, 2026
Merged

[5.4] onContentPrepare in mod_articles#47467
muhme merged 4 commits intojoomla:5.4-devfrom
chmst:54-mod-articles-content-prepare

Conversation

@chmst
Copy link
Copy Markdown
Contributor

@chmst chmst commented Mar 25, 2026

Pull Request resolves #45809 .
New for #45813 which was closed and removed by mistake. sorry for that.

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

Added event onContentPrepare to mod_articles

Testing Instructions

see #45809
Use a plugin which uses onContentPrepare.

For a test you can use this plugin (AI generated, for this test only). It adds a line "hi there" into articles if there is some text to display.
prtest.zip

When you apply the PR, please check different combinations of display params in mod_articles.

Actual result BEFORE applying this Pull Request

onContentPrepare is not triggered

Expected result AFTER applying this Pull Request

onContentPrepare is triggered if a text exists

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-5.4-dev labels Mar 25, 2026
@ramalama
Copy link
Copy Markdown

I have tested this item ✅ successfully on 05b1100

Tested with my custom template. Before: No onContentPrepare Event was fired. After: Event was fired and I could sucessfully hook into it.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47467.

@LadySolveig
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on 05b1100


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47467.

@richard67 richard67 removed the bug label Mar 25, 2026
@richard67
Copy link
Copy Markdown
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47467.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 25, 2026
@richard67 richard67 added the bug label Mar 25, 2026
@muhme
Copy link
Copy Markdown
Contributor

muhme commented Apr 1, 2026

✅ Final test before merge with JBT

  • Installed and enabled 'Content - PR Test' plugin
  • Created 'Articles' site modules with 'Trigger Plugin events' enabled
  • Missing the to be inserted text
  • Applied PR with Patch Tester
    • Text inserted with onContentPrepare
    • If 'Title only' or 'Introtext' is hide still no text is shown
    • If 'Trigger Plugin Events' is disabled, nothing inserted
    • 'Introtext Limit' is still working
    • Seen extended inline help

@muhme muhme merged commit 3f10ab7 into joomla:5.4-dev Apr 1, 2026
70 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Apr 1, 2026
@muhme muhme modified the milestone: Joomla! 5.4.5 Apr 1, 2026
@muhme
Copy link
Copy Markdown
Contributor

muhme commented Apr 1, 2026

Thank you very much @chmst for your contribution. Thanks to @ramalama and @LadySolveig for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing plugin event onContentPrepare in \modules\mod_articles\src\Helper\ArticlesHelper.php

7 participants