Add statistics in mod_stats (front end) depending on the event "onGetStats" #15998
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of Changes
I added showing statistics in mod_stats (front end) depending on the event "onGetStats".
And I deleted the fix way, web links counted the stats.
mod_stats_admin used the event "onGetStats" already.
Testing Instructions
Install web links https://github.com/joomla-extensions/weblinks/releases
Create a web link and a menu item for showing the web link per category.
Open frond end and click the web link so stats are collected.
Create a module that shows statistics in frond end and select hit counter. Select a position for this module and show it on all pages.
Navigate to the front page and see, that the stats for web links are shown
Navigate to the plugin manager and see, that the plugin System - Web Links is not active
Apply my patch and see, that stats are shown if the plugin is active and they are not shown, if the plugin is not active.
Expected result
If the plugin System - Web Links is not active, there should no stats are shown.
Actual result
Stats are shown in the front end for the component web links independent of the plugin System - Web Links.
If another component used the event "onGetStats", these stats are only shown in the back end module
mod_stats_admin and not in the frond end module mod_stats.