Skip to content

Added plugin event triggers to the new mod_articles module#44132

Merged
Hackwar merged 7 commits intojoomla:5.2-devfrom
RickR2H:plugin-events
Sep 27, 2024
Merged

Added plugin event triggers to the new mod_articles module#44132
Hackwar merged 7 commits intojoomla:5.2-devfrom
RickR2H:plugin-events

Conversation

@RickR2H
Copy link
Member

@RickR2H RickR2H commented Sep 24, 2024

Pull Request for Issue # .

Summary of Changes

With #43738 a new articles module is added. This new module mod_articles module has no option to trigger the plugin events. In the mod_articles_news this options was present. This PR adds the option to this module.

Testing Instructions

  1. Activate the option: Trigger Plugin Events.
  2. Create three custom fields of type text and add then to each plugin event.
  3. The custom field output is shown in for each article.

Actual result BEFORE applying this Pull Request

No option to trigger plugin events.

Expected result AFTER applying this Pull Request

Plugin events afterDisplayTitle, beforeDisplayContent and afterDisplayContent are triggered for each article.

Link to documentations

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

@RickR2H RickR2H requested a review from chmst as a code owner September 24, 2024 15:25
@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-5.2-dev labels Sep 24, 2024
@RickR2H RickR2H changed the title Added plugin event triggers Added plugin event triggers to the new mod_articles module Sep 24, 2024
@Fedik Fedik added the Feature label Sep 25, 2024
@Kostelano
Copy link
Contributor

Kostelano commented Sep 26, 2024

The module parameters are also used in the plugin with demo data. We probably need to make changes in file plugins/sampledata/blog/src/Extension/Blog.php, because demo data creates 3 modules of type ARTICLES after installation.

UPD
Or do it after merging about 5 new PRs for this module.

@hans2103
Copy link
Contributor

I have tested this item ✅ successfully on a5a2329


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

1 similar comment
@JeroenMoolenschot
Copy link
Member

I have tested this item ✅ successfully on a5a2329


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

@RickR2H
Copy link
Member Author

RickR2H commented Sep 27, 2024

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Sep 27, 2024
@Hackwar Hackwar merged commit 1745bb9 into joomla:5.2-dev Sep 27, 2024
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Sep 27, 2024
@Hackwar Hackwar added this to the Joomla! 5.2.0 milestone Sep 27, 2024
@Hackwar
Copy link
Member

Hackwar commented Sep 27, 2024

Thanks for your contribution @RickR2H

PluginHelper::importPlugin('content', null, true, $dispatcher);

$contentEventArguments = [
'context' => 'com_content.article',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was merged with wrong context, what happened? 😄

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the mod_articles context will not load the custom fields. It needs to go through com_content or else information will be missing. I didn't feel like change plugin events.

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

Labels

Feature Language Change This is for Translators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants