User tests: Successful: Unsuccessful:
Pull Request for Issue #25302
Corrected conditional
Install via Manager install
plg_system_stopHitCounts-J4-1.3.0-alpha.zip
(I modified the changelogurl in the xml of this plugin as there was a typo)
and
fr-FR_joomla_lang_full_3.9.7v1.zip
Then display administrator/index.php?option=com_installer&view=update
Also display administrator/index.php?option=com_installer&view=manage
Display there the French package and then the plugin
The French language pack does not get the Changelog button but N/A
while the plugin does and clicking on it displays the Changelog in the modal
In the Manage view:
For the French package: the installed version is not clickable
For the plugin it is clickable and the modal is displayed with changelog informations for the installed version
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_installer |
Labels |
Added:
?
|
I have tested this item
I have tested this item
Now it works as it should. Thanks
Status | Pending | ⇒ | Ready to Commit |
Status "Ready To Commit".
Labels |
Added:
?
|
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-06-24 12:34:41 |
Closed_By | ⇒ | wilsonge |
Thanks!
I modified the changelogurl in the xml of this plugin as there was a typo
Can you please tell me the kind of what the typo was?
When it was the "...../changelog(s).xml" instead of the "...../changelog.xml" then this error is changed in the source already.
You can find the latest version under: https://github.com/hgh-esn/plg_system_stopHitCounts-J4/archive/V1.3.0-alpha.zip
That was the typo indeed.
@wilsonge Shouldn't there be added a comment in code that the not strict comparison is needed here? Otherwise I am pretty sure we will sooner or later see a PR which wants to change that back because he/she thinks strict is always better (which would be wrong in this case).
To be honest I’d always rather have strict comparisons. Looking again is there a reason we don’t use empty?
@wilsonge & @richard67
Hint: The reason I modified the conditional from
<?php if ($item->changelogurl !== '') : ?>
to
<?php if ($item->changelogurl != null) : ?>
was because I found out that the version of the en-GB package in the Manage view was still clickable.
Same issue if I use empty
for every item in the Manage manager.
In both cases NULL
is not equal to empty
or ''
I have tested further though and I found that
<?php if (isset($item->changelogurl)) : ?>
always work in the Manage view but NOT in the update view.
I am afraid we have to keep != null
According to the php docs https://www.php.net/manual/en/function.empty.php null is considered empty. Any idea what the en-GB language pack is passing in then as a value?
I tested with <?php if (!empty($item->changelogurl)) : ?>
in both views (manage and update) and for me it works. In the manage view I get the version without a link and in the update-view I get the N/A.
Should we switch to <?php if (!empty($item->changelogurl)) : ?>
?
if it works then yes i'd rather use that
apart from the horrendous accessibility and UI issues in view=manage which are beyond the scope of this pr this works correctly