avatar obuisard
obuisard
28 Aug 2021

Steps to reproduce the issue

Download the custom recaptcha plugin at https://simplifyyourweb.com/free-products/image-from-article/files/file/161-image-from-article#download and install under Joomla 3.10.

The update file contains several tags, each one targeting a different platform.
One update tag has targetplatform 3.1 and a version higher than the version you have installed,
an other tag has targetplatform 3.10 and the same version number as the version installed.

Go to extensions update. Do a 'clear cache' then 'find updates'.

Expected result

There should not be any update for 'Image from article'.

Actual result

There is an update for 'Image from article'.

System information (as much as possible)

Joomla 3.10. But I believe this is a general error, it was just not visible until 3.10 came along.

Additional comments

It seems like that when there are 2 update tags with both target platforms 3.1 and 3.10 (or a mix like 3.[8.9]|10), 3.1 is the selected platform, no matter what.
You would get the same results if both update tags had the same version number, higher than the version installed. I did not do it here so it is clear that the platform targeted is indeed 3.1, not 3.10.

In administrator/components/com_installer/models/update.php, the JUpdate object inside the 'update' function shows the target platform being 3.1, not 3.10.

avatar obuisard obuisard - open - 28 Aug 2021
avatar obuisard obuisard - change - 28 Aug 2021
Title
[3.10] wrong target platform when updating extensions with 3.1 and 3.10 target platforms in xml update file
[3.10] wrong target platform when updating extensions with both 3.1 and 3.10 target platforms in xml update file
avatar obuisard obuisard - edited - 28 Aug 2021
avatar richard67
richard67 - comment - 29 Aug 2021

For reference here the relevant parts of the update site XML http://www.barejoomlatemplates.com/autoupdates/imagefromarticle/imagefromarticle-pkg-update.xml :

<?xml version="1.0" encoding="utf-8"?>
<updates>
   <update>
...
      <version>1.4.2</version> 
...
      <targetplatform name="joomla" version="3.1" />
   </update>
   <update>
...
      <version>1.4.1</version> 
...
      <targetplatform name="joomla" version="3.[23456789]" />
   </update>
   <update>
...
      <version>1.4.1</version> 
...
      <targetplatform name="joomla" version="3.10" />
   </update>
</updates>

As far as I know, the extensions installer uses the targetplatform as a regular expression, and in a regex the dot means "any character".

Maybe it would help to escape the dots with a backslash, so we have:

<targetplatform name="joomla" version="3\.1" />
<targetplatform name="joomla" version="3\.[23456789]" />
<targetplatform name="joomla" version="3\.10" />

If that is the case, we need to update all docs and our own examples in the CMS and the core supported extensions and whatever boilerplates to clearly tell that.

avatar richard67
richard67 - comment - 29 Aug 2021

I think the solution could be that they escape the dots AND make the patch for the 3.1 version be more precise by adding the patch version part:

<targetplatform name="joomla" version="3\.1\.[0-9]" />
<targetplatform name="joomla" version="3\.[23456789]" />
<targetplatform name="joomla" version="3\.10" />
avatar richard67
richard67 - comment - 29 Aug 2021

Same for extensions which would have only one version for 3.0 to 3.9:

<targetplatform name="joomla" version="3\.[0-9]\.[0-9]" />
<targetplatform name="joomla" version="3\.10" />
avatar richard67
richard67 - comment - 29 Aug 2021

But the above suggestions could be a problem with development versions like 3.10-rc1 or so.

avatar brianteeman
brianteeman - comment - 29 Aug 2021

<targetplatform name="joomla" version="((3\.(8|9|10))|(4\.0))"/>

But the above suggestions could be a problem with development versions like 3.10-rc1 or so.

iirc the rc1 part is stripped in the extensionadapter

avatar richard67
richard67 - comment - 29 Aug 2021

Yes, so as long as people use e.g. 3.1.1-rc1 and not 3.1-rc1, all is fine with my suggestions.

The problem I see: In our docs about how to make update sites and also in our own examples here and there we almost never escape the dot, as far as I remember. So if I'm right we need to update our docs and all our examples so we are not teaching people wrong.

avatar richard67
richard67 - comment - 29 Aug 2021

If this is fixed by the 3rd party devs so they correctly escape the dots and so on, we still have an issue with the pre-update checker, see #35384 .

avatar pl71
pl71 - comment - 18 Nov 2021

Would be nice a little bit more info about tags here.
defaults to what? Suppose to the latest Joomla.


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

avatar pl71
pl71 - comment - 18 Nov 2021

The missing code from the post above:
<targetplatform name="joomla" version=""/>


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

avatar zero-24
zero-24 - comment - 18 Nov 2021

@pl71 can you please clarify what your question is? When the tag is not set the update is proposed to all joomla versions. As it is not specificly set for J4 the pre upgrade checker should tell you that.

avatar pl71
pl71 - comment - 19 Nov 2021

Missing value suits J4 as well. Thank you. REGEX sample from the above should be in the Docs section.


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

avatar brianteeman
brianteeman - comment - 23 Aug 2022

Thank you for raising this issue.

Joomla 3 is now in security only mode with no further bug fixes or new features.

As this issue doesn't relate to Joomla 4 it will now been closed.

If we are mistaken and this does apply to Joomla 4 please open a new issue (and reference this one if you wish) with updated details for testing in Joomla 4.
cc @zero-24 please double check before closing this - thanks

avatar obuisard
obuisard - comment - 23 Aug 2022

Thank you, Brian @brianteeman. This can be closed since the project should never go all the way to a .10 version and run into the same issues again.

avatar brianteeman
brianteeman - comment - 23 Aug 2022

You can close it yourself ;)

avatar zero-24 zero-24 - change - 23 Aug 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-08-23 18:33:17
Closed_By zero-24
avatar zero-24 zero-24 - close - 23 Aug 2022

Add a Comment

Login with GitHub to post a comment