? Pending

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
22 Apr 2021

Pull Request for Issue #33253

Summary of Changes

Show preview of stats even if the module is unpublished

Testing Instructions

Install Joomla 4
edit "System - Joomla! Statistics" plugin
Disable the plugin and save it
edit "System - Joomla! Statistics" plugin
Click "Select here to see the information that will be sent."

Actual result BEFORE applying this Pull Request

When the plugin is disabled there is no data preview

Screen.Recording.2021-04-22.at.08.31.19.pm.mp4

Expected result AFTER applying this Pull Request

a list of system info that will be sent to the stats server, to allow me to make an informed decision to enable this plugin

Screen.Recording.2021-04-22.at.08.33.09.pm.mp4

Documentation Changes Required

none

avatar PhilETaylor PhilETaylor - open - 22 Apr 2021
avatar PhilETaylor PhilETaylor - change - 22 Apr 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Apr 2021
Category Front End Plugins
avatar PhilETaylor PhilETaylor - change - 22 Apr 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 22 Apr 2021
avatar PhilETaylor PhilETaylor - change - 22 Apr 2021
Title
Show stats preview when unpublished
[4] Show stats preview when unpublished
avatar PhilETaylor PhilETaylor - edited - 22 Apr 2021
avatar PhilETaylor PhilETaylor - change - 22 Apr 2021
Labels Added: ?
avatar sandramay0905 sandramay0905 - test_item - 23 Apr 2021 - Tested successfully
avatar sandramay0905
sandramay0905 - comment - 23 Apr 2021

I have tested this item successfully on 1670a00


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

avatar Fedik
Fedik - comment - 23 Apr 2021

Sorry, the fix is to hacky, and will show a bad example for other developers.

I think, here would be better to show the message that explain to User what is going on, when plugin is disabled:
The preview not available for unpublished plugin, please do "this" and "this"....

Or just hide whole "preview section" for unpublished plugin.

avatar PhilETaylor
PhilETaylor - comment - 23 Apr 2021

Sorry, the fix is to hacky, and will show a bad example for other developers.

You mean like much of the code in Joomla...

avatar PhilETaylor PhilETaylor - change - 23 Apr 2021
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2021-04-23 09:11:36
Closed_By PhilETaylor
avatar PhilETaylor PhilETaylor - close - 23 Apr 2021
avatar PhilETaylor
PhilETaylor - comment - 23 Apr 2021

The problem is that the dataField has no knowledge of whether the plugin is disabled or not... so another hack needed to find that information...

avatar Fedik
Fedik - comment - 23 Apr 2021

You mean like much of the code in Joomla...

Sorry, I did not meant to offend someone.

The problem is that the dataField has no knowledge of whether the plugin is disabled or not

There PluginHelper::isEnabled().

Or maybe this does not need, just improve the message, around:
The data not available, there is no data or the plugin is disabled and so data collection also disabled. Please check if plugin enabled
Or something like that, I am not strong in English.

avatar PhilETaylor
PhilETaylor - comment - 23 Apr 2021

PluginHelper::isEnabled() doesnt do what it says it does. I already wasted time on that. I'll just hide everything if there is no stats returned (no stats returned = the plugin is disabled so the triggerEvent doesnt return stats)

avatar Fedik
Fedik - comment - 23 Apr 2021

PluginHelper::isEnabled() doesnt do what it says it does.

I just checked on j3 var_dump(JPluginHelper::isEnabled('system', 'stats')) return correct true/false, when enabled/disable
Cannot check on j4 currently, but the code is the same there.

avatar PhilETaylor
PhilETaylor - comment - 23 Apr 2021

checking if its disabled was not the problem anyway...

replacement #33261

Add a Comment

Login with GitHub to post a comment