-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Support collection of custom stats in stats frontend module #15138
Conversation
This reverts commit 8072e58.
@franz-wohlkoenig as you have tested the weblinks PR you have also tested here ;) |
I have tested this item ✅ successfully on 9883fad This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15138. |
@zero-24 adding the onGetStats function to a system plugin already adding a new row before applying your patch? |
Yes in the backend but not in the frontend module. |
I have tested this item 🔴 unsuccessfully on 9883fad This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15138. |
fixed please test again @sanderpotjer |
I have tested this item ✅ successfully on f9dd52a This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15138. |
@zero-24 thanks, that fixed it! |
I have tested this item ✅ successfully on f9dd52a This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15138. |
modules/mod_stats/helper.php
Outdated
// Include additional data defined by published system plugins | ||
JPluginHelper::importPlugin('system'); | ||
|
||
$app = JFactory::getApplication(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this line 148 ($app = JFactory::getApplication();), because it is already defined earlier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
I have tested this item ✅ successfully on 84c2ee7 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15138. |
I have tested this item ✅ successfully on f9dd52a This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/15138. |
Summary of Changes
Similar to how the backend module triggers an event to add additional items to its output, this adds support for the
mod_stats
module to do the same.A new
onGetStats
event is published with a single parameter, a context (hardcoded tomod_stats_admin
) and any plugin responding to this event is expected to return an array matching this schema:The title and data attributes MUST be defined or a row is not added.
Similar to the quickicons implementation, items can NOT be removed via the plugin event.
Testing Instructions
Add the following method to a system plugin:
With the admin stats module enabled, you should see a new row with this data.
Based on the same thing that @mbabker did for the backend: #10870
The weblinks part is moved here: https://github.com/joomla-extensions/weblinks/pull/333/files to be included in the 3.7 version.