User tests: Successful: Unsuccessful:
Pull Request for Issue #35384 .
Alternative to #35419 .
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.
Have a clean installation of current 3.10-dev or latest 3.10 nightly or 3.10.1.
In the options of the Joomla Update component, set the update channel to "Joomla Next".
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.
In the options of the extensions installer, make sure that you have minimum stability set to "Stable".
Go to "Components -> Joomla Update". The pre-update checker should be shown for update to Joomla 4.0.2.
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.
Go to the extensions installer's options and change minimum stability to "Release Candidate".
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.
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.
Install some other extensions, e.g. Patchtester 3.0.0 https://github.com/joomla-extensions/patchtester/releases/download/3.0.0/com_patchtester.zip .
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.
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.
Go to the extensions installer's options and change minimum stability to "Release Candidate".
Make a backup of file "libraries/src/Updater/Update.php".
Apply the patch of this PR.
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".
Check the Joomla 4.0.2 compatible version of the weblinks package.
Result: Version 3.9.0-rc1 is shown as it should be.
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.
Go to the extensions installer's options and change minimum stability to "Stable".
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.
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.
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.
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.
See issue #35384 .
The issue is fixed, everything else works as before or better.
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.
None.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_joomlaupdate Libraries |
Title |
|
Labels |
Added:
?
|
I have tested this item
Tested as much as I can and see that it is working as expected, so marking my test result as success.
@joomdonation Thanks for reviews and testing.
I have tested this item
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.
I'm going to merge this here in now
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-09-11 17:43:28 |
Closed_By | ⇒ | zero-24 |
@jedresse1 I've reported you to GitHub for spamming and will delete your posts.