?
avatar nikosdion
nikosdion
2 Jun 2021

Steps to reproduce the issue

  • Install any extension compatible with Joomla 4, such as the latest versions of JCE.
  • Edit Version.php to fake the current Joomla version as 4.0.0-beta8 (which will allow Joomla Update to find an update to the CMS version 4.0.0-rc1, the current version at the time of this writing).
  • Go to System, Update, Extensions and click on Check for Updates to verify Joomla has the latest extension update information.
  • Go to System, Update, Joomla.
  • Look at the Pre-update Check results.

Expected result

The third party extension (JCE) which is definitely compatible with Joomla 4.0, per its XML update source file, appears as such.

Actual result

You get a misleading and scary message titled “JCE Pro Extension Package Potentially Serious Problem. More Information.” which says that you need to update the extension and if you don't the update will fail.

Moreover, when you click on More Detail you get even more confusing and wrong information. You are told that the currently installed version is the latest version installed and it has "No compatibility information" with 4.0.0-rc1 even though the XML update source clearly states that 4.0 is an accepted target.

System information (as much as possible)

Completely irrelevant. This is a JavaScript issue affecting all environments.

Additional comments

I had reported this issue back in the Alpha 10 or Alpha 12 days (it was a long time ago...). I was told that my update source was wrong — even though it was valid, marked the extensions as compatible with Joomla 4 and I could prove it by the fact that my extension updates worked in Joomla 4. This time I am filing the same bug report using a non-Akeeba extension, proving the point that the bug does exist, has been there for at least two years and needs to be fixed. Sorry it took so long, no developer but yours truly would start supporting Joomla 4 before it even hit beta.

Here's how I debugged this issue and how to fix it.

Opening your browser's dev tools and going to the Network tab you will see that the AJAX URL is glaringly wrong: http://localhost/joomla4/administrator/index.php?option=com_joomlaupdate&task=update.fetchextensioncompatibility&joomla-target-version=4.0.0-rc1joomla-current-version=4.0.0-rc1extension-version=2.9.7&extension-id=317

Have you spotted the missing ampersands yet? So, let's see where these come from.

Searching Joomla's code base for update.fetchextensioncompatibility leads us to

}&joomla-target-version=${encodeURIComponent(PreUpdateChecker.joomlaTargetVersion)

As you can see, lines 305 and 306 are missing an ampersand each. The resulting URL is wrong because it passes NEITHER the current Joomla version NOR the extension version, leading to the wrong result and the misleading information.

I have confirmed that adding the two missing ampersands fixes the problem. I confirmed this with JCE. I also confirmed the fix with Akeeba extensions — the same extensions I had used when I first reported this bug nearly two years ago.

I will be happy to provide a PR and/or further technical information if you'd like.

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar nikosdion nikosdion - open - 2 Jun 2021
avatar joomla-cms-bot joomla-cms-bot - change - 2 Jun 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 2 Jun 2021
avatar joomdonation
joomdonation - comment - 2 Jun 2021

@nikosdion You understand the issue and know the solution, so it would be great if you could create PR to solve it. Thanks !

avatar nikosdion
nikosdion - comment - 2 Jun 2021

Will do!

avatar nikosdion
nikosdion - comment - 2 Jun 2021

Here's the PR.

avatar joomdonation
joomdonation - comment - 2 Jun 2021

Great. Many thanks. Link to PR is #34354 . We will get it tested and merged.

avatar joomdonation joomdonation - close - 2 Jun 2021
avatar joomdonation joomdonation - change - 2 Jun 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-06-02 07:08:27
Closed_By joomdonation

Add a Comment

Login with GitHub to post a comment