? ? Pending

User tests: Successful: Unsuccessful:

avatar infograf768
infograf768
24 Jun 2019

Pull Request for Issue #25302

Summary of Changes

Corrected conditional

Testing Instructions

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

After patch

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

Screen Shot 2019-06-24 at 12 04 00

Screen Shot 2019-06-24 at 12 04 11

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

avatar infograf768 infograf768 - open - 24 Jun 2019
avatar infograf768 infograf768 - change - 24 Jun 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 24 Jun 2019
Category Administration com_installer
avatar infograf768 infograf768 - change - 24 Jun 2019
Labels Added: ?
avatar brianteeman
brianteeman - comment - 24 Jun 2019

apart from the horrendous accessibility and UI issues in view=manage which are beyond the scope of this pr this works correctly

avatar brianteeman brianteeman - test_item - 24 Jun 2019 - Tested successfully
avatar brianteeman
brianteeman - comment - 24 Jun 2019

I have tested this item successfully on 3bebcf1


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

avatar hgh-esn hgh-esn - test_item - 24 Jun 2019 - Tested successfully
avatar hgh-esn
hgh-esn - comment - 24 Jun 2019

I have tested this item successfully on 3bebcf1

Now it works as it should. Thanks


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

avatar franz-wohlkoenig franz-wohlkoenig - change - 24 Jun 2019
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 24 Jun 2019

Status "Ready To Commit".

avatar infograf768 infograf768 - change - 24 Jun 2019
Labels Added: ?
avatar wilsonge wilsonge - change - 24 Jun 2019
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
avatar wilsonge wilsonge - close - 24 Jun 2019
avatar wilsonge wilsonge - merge - 24 Jun 2019
avatar wilsonge
wilsonge - comment - 24 Jun 2019

Thanks!

avatar hgh-esn
hgh-esn - comment - 24 Jun 2019

@infograf768

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

avatar infograf768
infograf768 - comment - 24 Jun 2019

That was the typo indeed.

avatar richard67
richard67 - comment - 24 Jun 2019

@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).

avatar wilsonge
wilsonge - comment - 24 Jun 2019

To be honest I’d always rather have strict comparisons. Looking again is there a reason we don’t use empty?

avatar infograf768
infograf768 - comment - 25 Jun 2019

@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

avatar wilsonge
wilsonge - comment - 25 Jun 2019

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?

avatar hgh-esn
hgh-esn - comment - 25 Jun 2019

@wilsonge @infograf768

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.

avatar hgh-esn
hgh-esn - comment - 28 Jun 2019

@wilsonge @infograf768

Should we switch to <?php if (!empty($item->changelogurl)) : ?> ?

avatar wilsonge
wilsonge - comment - 28 Jun 2019

if it works then yes i'd rather use that

avatar infograf768
infograf768 - comment - 29 Jun 2019

Sorry folks, was not available. I guessed I messed up when testing !empty at the time.
Please test #25363

Add a Comment

Login with GitHub to post a comment