User tests: Successful: Unsuccessful:
Pull Request for Issue #35384.
Currently, the pre-update checker compares the current installed version of an extension with the latest compatible version (with the Joomla version the site is going to update to) instead of minimum compatible version and it causes the misdleading update required as described in #35384 . This PR solves that.
Install Joomla 3.10.1
Set Update Channel to Joomla Next.
Go to Extensions -> Manage -> Install, click on Options button in the toolbar and set Minimum Stability to Release Candidate (this step is needed because the extension I provide for testing here is in RC release only. If you use a stable extension for testing, please ignore this step)
Install weblinks 3.9.10-rc1 in the attachment
pkg-weblinks-3.9.0-rc1.zip
Go to Components -> Joomla Update, Joomla should prompt you to update to Joomla 4.0.2 like in the screenshot below
The pre-update checker still marks the extensions as update required although the extension has indicates that the version is compatible with Joomla 4 already. See update element for 3.9.0-rc1 element
<targetplatform name="joomla" version="((3\.(9|10))|(4\.0))"/>
Category | ⇒ | Administration com_joomlaupdate Libraries |
It seems to me that unfortunately the updater has no information about the currently installed version of an extension and so can't pick up the right update information with version greater or equal to currently installed. I hope so much that I'm wrong with that, otherwise it could become a bigger thing to change.
@joomdonation I think the problem comes from the updater's Update: No, the getUpdateObjectsForSite
function having default value = false for the $includeCurrent
parameter here https://github.com/joomla/joomla-cms/blob/3.10-dev/libraries/src/Updater/Updater.php#L269 , and so it checks only for versions greater than the installed one here https://github.com/joomla/joomla-cms/blob/3.10-dev/libraries/src/Updater/Updater.php#L289 and here https://github.com/joomla/joomla-cms/blob/3.10-dev/libraries/src/Updater/Updater.php#L361 .$includeCurrent
parameter is only present for the CMS update, but not for the extensions update here: https://github.com/joomla/joomla-cms/blob/3.10-dev/administrator/components/com_installer/models/update.php#L256 .
@joomdonation Why I did not get any compatibility information I know now: I had not changed the minimum stability in the options of the extensions installer, so it was still "stable", and so the rc1 was not accepted..
@zero-24 I would like to receive your feedback for this PR. It addresses the issue, however, as shown in the the screenshot which Richard posted, the version shows in Joomla 4 Compatible Version is now minimum compatible version, so it could be lower version compare to the current installed version.
I think it is OK because if the lower version is compatible with Joomla 4, then of course the installed version (which could be newer version) will also be compatible Joomla 4, and there should not be any problem. However @richard67 thinks that it could be confusing and proposed a ready to use PR joomdonation#3 to make the system return the compatible version which is greater than or equal current installed version. While it works, it requires more changes and could be a bit harder to maintain the code.
How do you think about it? We can discuss directly on Glip if needed. Thanks !
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-09-11 09:41:35 |
Closed_By | ⇒ | joomdonation | |
Labels |
Added:
?
|
@joomdonation I've tested and noticed 2 things:
In both cases without and with this PR, I get no update information available for the weblinks package which I have downloaded via the link provided in the description and installed on a copy of my 3.10.1 homepage. See the red ellipse mark in the below 2 images. Update: It needs so set minimum stability in the extension installer's option to something lower than "Stable".
The search for the oldest compatible version should be limited to the currently installed version and not show versions older than that.
Without the changes of this PR applied, I get:
The green frames show where the currently installed version is compatible.
The patchtester version 2.0.1 and not the installed 3.0.0 is shown as compatible with the current CMS 3.10.1 also without the patch of this PR, see the orange frame.
With the changes of this PR applied, I get:
The red frames show where the currently installed version would be compatible but a lower version is shown.
For the patchtester nothing has changes, see orange frame.
Why I don't get any compatibility info for the weblinks I don't know.Update: It needs so set minimum stability in the extension installer's option to something lower than "Stable".