? Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
30 Aug 2021

Pull Request for Issue #35384.

Summary of Changes

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.

Testing Instructions

  1. Install Joomla 3.10.1

  2. Set Update Channel to Joomla Next.

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

  4. Install weblinks 3.9.10-rc1 in the attachment
    pkg-weblinks-3.9.0-rc1.zip

  5. Go to Components -> Joomla Update, Joomla should prompt you to update to Joomla 4.0.2 like in the screenshot below

update_to_402

Actual result BEFORE applying this Pull Request

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))"/>

update_to_402

Expected result AFTER applying this Pull Request

No update is required. It's green.
no_update_required

avatar joomdonation joomdonation - open - 30 Aug 2021
avatar joomdonation joomdonation - change - 30 Aug 2021
The description was changed
avatar joomdonation joomdonation - edited - 30 Aug 2021
avatar joomla-cms-bot joomla-cms-bot - change - 30 Aug 2021
Category Administration com_joomlaupdate Libraries
avatar joomdonation joomdonation - change - 30 Aug 2021
The description was changed
avatar joomdonation joomdonation - edited - 30 Aug 2021
avatar richard67
richard67 - comment - 1 Sep 2021

@joomdonation I've tested and noticed 2 things:

  1. 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".

  2. 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:

2021-09-01_j3-test-pr-35419_without-pr

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:

2021-09-01_j3-test-pr-35419_with-pr

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".

avatar richard67
richard67 - comment - 1 Sep 2021

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.

avatar richard67
richard67 - comment - 1 Sep 2021

@joomdonation I think the problem comes from the updater's 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 . Update: No, the $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 .

avatar richard67
richard67 - comment - 1 Sep 2021

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

avatar joomdonation
joomdonation - comment - 5 Sep 2021

@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 !

avatar richard67
richard67 - comment - 8 Sep 2021

I have an alternative proposal, I only need to complete testing instructions later (need a break now): #35510 .

avatar richard67
richard67 - comment - 8 Sep 2021

Please check #35510 , it's ready now.

avatar joomdonation
joomdonation - comment - 11 Sep 2021

Closing in favor if #35510

avatar joomdonation joomdonation - close - 11 Sep 2021
avatar joomdonation joomdonation - change - 11 Sep 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-09-11 09:41:35
Closed_By joomdonation
Labels Added: ?

Add a Comment

Login with GitHub to post a comment