Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add trigger to com_content front category model #4656

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions components/com_content/models/category.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ function getItems()
$model->setState('filter.max_category_levels', $this->getState('filter.max_category_levels'));
$model->setState('list.links', $this->getState('list.links'));

$dispatcher = JEventDispatcher::getInstance();
// Include the content plugins for the change of category state event
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix the comment as it is not a change of category state event.

JPluginHelper::importPlugin('content');
// Trigger the onCategoryChangeState event
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix the comment as it is not a change of category state event.

$dispatcher->trigger('onGetContentItems', array(&$model));
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need to fetch the dispatcher as an own object and trigger it. Just use JFactory::getApplication()->triggerEvent('onGetContentItems', array(&$model)))


if ($limit >= 0)
{
$this->_articles = $model->getItems();
Expand Down