? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
8 Sep 2021

Pull Request for Issue #35384 .

Alternative to #35419 .

Summary of Changes

Currently the pre-update checker checks compatibility separately for the current (here 3.10.x) and the target CMS (here 4.0.y) versions, using the latest available, compatible update version for each CMS version.

This means if there is an update which would be compatible with both CMS versions and a later update which is only compatible with the target CMS version, the checker uses the latter and so reports an update to be required (which would be wrong and could even break things). See issue #35384 .

This PR here fixes that by using the latest update version which is compatible with both CMS versions, if there is such, and otherwise still like it is without this PR the latest update for the target CMS version.

In addition, it fixes the compatibility check. Right now, an extension is shown as not compatible with the target CMS version if the latest available update version for the that CMS version is younger than the installed version of the extension, but this is wrong. The extension can be assumed to be compatible with the target if the installed version is not older than the oldest available update for the target CMS version, or in other words, there is at least one update which is known to be compatible and is older than or equal to the installed version.

These both fixes together solve the issue.

In any case the extension versions shown for the two CMS versions in the pre-update checker's details are the latest available versions (with respect to the first change mentioned above), so even for the extensions which have no update required you can see that an update is available by the version numbers.

It could be worth to think about a future PR either extending the pre-update checker by a new category "Update Recommended" for such cases or visualizing in another way that updates are available for compatible extensions.

The change in the Joomla update component has been made in a way so that it works without the change in the updater library like it does now without the PR, so if it needs to release a separate update of the component before the CMS release for some other reason, the updated component will still work before the CMS is updated.

Testing Instructions

  1. Have a clean installation of current 3.10-dev or latest 3.10 nightly or 3.10.1.

  2. In the options of the Joomla Update component, set the update channel to "Joomla Next".

  3. Install version 3.9.0 RC1 of the Weblinks component from here https://github.com/joomla-extensions/weblinks/releases/download/3.9.0-rc1/pkg-weblinks-3.9.0-rc1.zip . This is the example which we use for checking the issue.

  4. In the options of the extensions installer, make sure that you have minimum stability set to "Stable".

  5. Go to "Components -> Joomla Update". The pre-update checker should be shown for update to Joomla 4.0.2.

  6. Check in which category the "Web Links Extension Package" is shown.
    Result: The extension is shown in the category "Update Information Unavailable". This is desired because that extension doesn't have stability "Stable" yet.

  7. Go to the extensions installer's options and change minimum stability to "Release Candidate".

  8. Go back to "Components -> Joomla Update" and check again in which category the "Web Links Extension Package" is shown.
    Result: The extension is shown in the category "Update Required". This is the problem reported with the issue.

  9. Check the Joomla 4.0.2 compatible version of the weblinks package.
    Result: Version 4.0.0-rc1 is shown, but it should be 3.9.0-rc1.

  10. Install some other extensions, e.g. Patchtester 3.0.0 https://github.com/joomla-extensions/patchtester/releases/download/3.0.0/com_patchtester.zip .

  11. Go back to "Components -> Joomla Update". Expand all "More Detail" toggles so you can see the version numbers shown in all categories of compatibility and make a screenshot so you can later compare all of them with the results after having applied the changes from this PR.

  12. If you have other extensions installed which have different stability levels than "Stable", play a bit with the minimum stability in the extensions installer's options to get different results, and make again screenshots with all "More Detail" toggles being expanded so you can later compare.

  13. Go to the extensions installer's options and change minimum stability to "Release Candidate".

  14. Make a backup of file "libraries/src/Updater/Update.php".

  15. Apply the patch of this PR.

  16. Go back to "Components -> Joomla Update" and check again in which category the "Web Links Extension Package" is shown.
    Result: The extension is shown in the category "No Update Required".

  17. Check the Joomla 4.0.2 compatible version of the weblinks package.
    Result: Version 3.9.0-rc1 is shown as it should be.

  18. Expand all "More Detail" toggles and compare the details show for all your extensions with the results from step 11.
    Result: There should be no changes beside the change for the weblinks package and for other packages having the same or a similar issue. But if there are changes, check if they make sense.

  19. Go to the extensions installer's options and change minimum stability to "Stable".

  20. Check in which category the "Web Links Extension Package" is shown.
    Result: The extension is shown in the category "Update Information Unavailable". This is desired because that extension doesn't have stability "Stable" yet.

  21. If you have other extensions installed which have different stability levels than "Stable", play a bit with the minimum stability in the extensions installer's options to get different results, and compare the results with those from step 12.
    Result: The minimum stability setting is respected as well as without this PR.

  22. Revert the changes of this PR in file "libraries/src/Updater/Update.php" by replacing it with backup file from step 14, but keep the other files changed by this PR.

  23. Check that everything works like it does without this PR and there are no PHP errors.
    Result: The changes in the Joomla Update component's code made by this PR work also with the old, unchanged version of the updater library, but of course without the issue being fixed, i.e. things work like without this PR.

Actual result BEFORE applying this Pull Request

See issue #35384 .

update_to_402

Expected result AFTER applying this Pull Request

The issue is fixed, everything else works as before or better.

no_update_required

The changes in the Joomla Update component's code made by this PR work also with the old, unchanged version of the updater library, but of course without the issue being fixed, i.e. things work like without this PR.

Documentation Changes Required

None.

avatar richard67 richard67 - open - 8 Sep 2021
avatar richard67 richard67 - change - 8 Sep 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 Sep 2021
Category Administration com_joomlaupdate Libraries
avatar richard67 richard67 - change - 8 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 8 Sep 2021
avatar richard67 richard67 - edited - 8 Sep 2021
avatar richard67 richard67 - change - 8 Sep 2021
The description was changed
avatar richard67 richard67 - change - 8 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 8 Sep 2021
avatar richard67 richard67 - change - 8 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 8 Sep 2021
avatar richard67 richard67 - change - 8 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 8 Sep 2021
avatar richard67 richard67 - change - 8 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 8 Sep 2021
avatar richard67 richard67 - change - 8 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 8 Sep 2021
avatar richard67 richard67 - change - 8 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 8 Sep 2021
avatar richard67 richard67 - change - 8 Sep 2021
Title
[3.10] [WiP] Fix misleading "Update Required" in the pre-update checker
[3.10] Fix misleading "Update Required" in the pre-update checker
avatar richard67 richard67 - edited - 8 Sep 2021
avatar richard67 richard67 - change - 8 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 8 Sep 2021
avatar richard67 richard67 - change - 8 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 8 Sep 2021
avatar richard67 richard67 - change - 8 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 8 Sep 2021
avatar richard67 richard67 - change - 8 Sep 2021
The description was changed
avatar richard67 richard67 - edited - 8 Sep 2021
avatar richard67
richard67 - comment - 9 Sep 2021

@jedresse1 I've reported you to GitHub for spamming and will delete your posts.

avatar richard67 richard67 - change - 11 Sep 2021
Labels Added: ?
5614c89 11 Sep 2021 avatar richard67 PHPCS
avatar joomdonation joomdonation - test_item - 11 Sep 2021 - Tested successfully
avatar joomdonation
joomdonation - comment - 11 Sep 2021

I have tested this item successfully on 5614c89

Tested as much as I can and see that it is working as expected, so marking my test result as success.


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

avatar richard67
richard67 - comment - 11 Sep 2021

@joomdonation Thanks for reviews and testing.

avatar zero-24 zero-24 - test_item - 11 Sep 2021 - Tested successfully
avatar zero-24
zero-24 - comment - 11 Sep 2021

I have tested this item successfully on 5614c89

Thanks you both for testing and the PR!
In order to test this with the weblinks package i had to create my own weblinks update server as the update server that is shipped with the package right now does not offer the RC versions that are needed for this to work. But thats expected too and works with and without this patch here anyway.


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

avatar zero-24
zero-24 - comment - 11 Sep 2021

I'm going to merge this here in now ?

avatar zero-24 zero-24 - change - 11 Sep 2021
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-09-11 17:43:28
Closed_By zero-24
avatar zero-24 zero-24 - close - 11 Sep 2021
avatar zero-24 zero-24 - merge - 11 Sep 2021

Add a Comment

Login with GitHub to post a comment