RTC bug PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar laoneo
laoneo
25 Apr 2025

Summary of Changes

When an extension has a new update site url, then a new update site is created and the update manager contains two update sites for the same extension. This pr updates the location only when an update site exists for an existing extension.

Testing Instructions

  • Install any extension with an update site. I tested it with the free DPCalendar upcoming module.
  • Modify in the database in the update_sites table the location of the newly installed extension by appending something like &demo=1 to the url.
  • Install the extension again.

Actual result BEFORE applying this Pull Request

There are two update sites for the same extension.

Expected result AFTER applying this Pull Request

Only one update site for the extension.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

Votes

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

avatar laoneo laoneo - open - 25 Apr 2025
avatar laoneo laoneo - change - 25 Apr 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 25 Apr 2025
Category Front End Plugins
avatar StefanSTS
StefanSTS - comment - 25 Apr 2025

Works as expected.
Pre testing:
Installed a component. Got one update server.
Installed the component with a different update server URL. Got two update servers in Joomla backend and DB tables.
Uninstalled extension. DB entries gone.

After applying the code to J 5.3 Joomla.php.
Different from the test instructions I used the installer with two different update server URL. Which would be the normal use case.

Installed component. got one update server.
Installed the component with different update server URL. Only one entry in DB and value for update site changed. No second entry.

avatar StefanSTS StefanSTS - test_item - 25 Apr 2025 - Tested successfully
avatar StefanSTS
StefanSTS - comment - 25 Apr 2025

I have tested this item ✅ successfully on 86c9c07


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

avatar degobbis degobbis - test_item - 25 Apr 2025 - Tested successfully
avatar degobbis
degobbis - comment - 25 Apr 2025

I have tested this item ✅ successfully on 86c9c07

Thank you very much, this is so inconspicuous but sooo important.


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

avatar richard67 richard67 - change - 25 Apr 2025
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 25 Apr 2025

RTC


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

avatar laoneo laoneo - change - 28 Apr 2025
Labels Added: RTC bug PR-5.3-dev
avatar laoneo
laoneo - comment - 28 Apr 2025

As an extension can have multiple update sites, I had to add an additional check if there is only one update site. This still covers the majority of use cases. Can you guys give this pr another test?

avatar StefanSTS
StefanSTS - comment - 28 Apr 2025

Do you still need tests? Because you deleted the post on Mattermost.
If there were two update sites previously, and in an update there is only one, doesn't it make sense to delete the old ones?

avatar laoneo
laoneo - comment - 28 Apr 2025

As I did a change, would be good to get some new tests.

avatar laoneo
laoneo - comment - 28 Apr 2025

Post on Matermost is still there.

avatar StefanSTS
StefanSTS - comment - 28 Apr 2025

Tested the simple version.

  1. update server in DB.
  2. installed new version with different update server URL.
  3. new URL in DB.
    That is fine.

Now I tried to install an extension with two update servers over the old extension.
One DB entry, and the URL of the second server element is used to update the old update URL in DB.

If I remove the extension, DB entries vanish. If I install the version with two server entries, only one is in DB.
So seems, only one entry is added to #__update_sites no matter how many entries in the xml.

If I change back to the original Joomla.php, two entries are added.

PS. So for testing we need to check the changes.

  • 1 entry -> 1 new entry
  • 1 entry -> 2 new entries
  • 2 entries -> 2 new (1old/1new) entries
  • 2 entries -> 1 new entry

And on new extension install.

  • 1 entry comes up new
  • 2 entries come up new
avatar QuyTon QuyTon - change - 28 Apr 2025
Status Ready to Commit Pending
avatar laoneo
laoneo - comment - 28 Apr 2025

Can you test this also without the patch? Pretty sure it is the same behavior.

avatar StefanSTS
StefanSTS - comment - 28 Apr 2025

I tested with the original Joomla.php. That one creates 2 entries.

avatar StefanSTS
StefanSTS - comment - 28 Apr 2025

There is a return added. Maybe that one.
EDIT: Removed that return, installs two update sites.
I'll test the other versions.

avatar laoneo
laoneo - comment - 28 Apr 2025

But the return comes only into action when there is one update site.

avatar StefanSTS
StefanSTS - comment - 28 Apr 2025

As it looks to me now, is it possible that addUpdateSite() is called twice?
So the logic for two different update sites is outside of the scope of this?
EDIT: Ah, there is processUpdateSites() in the same file which runs through a loop.

avatar laoneo
laoneo - comment - 28 Apr 2025

For two sites it is not possible to determine which one has updated. This needs to be handled in a different pr. This one here is only when there is one update site, which I guess most extensions have.

avatar StefanSTS
StefanSTS - comment - 28 Apr 2025

I think the logic has to go into processUpdateSites(), and from there, add another parameter for the IDs.
After that, calling addUpdateSite() and maybe new functions updateUpdateSite(), deleteUpdateSite().

Result at the moment:
Installing of extensions with one update site works, updating removes the update server alltogether.
Extensions with two update servers get only one entry: The name is of server 1, the URL of server 2.

avatar laoneo
laoneo - comment - 28 Apr 2025

@StefanSTS thanks for your extensive testing. Can you confirm that there is a different behavior without the patch? Because I'm not removing an update site at all in this pr.

avatar laoneo laoneo - change - 28 Apr 2025
Labels Removed: RTC
avatar StefanSTS
StefanSTS - comment - 28 Apr 2025

After the latest change, I can install an extension with 2 update sites, and they both show up in the list. Fixed.

Updating a "single update site" extension with another one, updates the URL. Works.
So that is all fine and works better now than before.

The only issue is the update site name <server....>name.
That name stays the same even if the URL is changed. If the name could be adjusted, that would work perfect.

Updating a "two update site" extension creates another pair of update sites, but as you said, that's for another day.

So as far as I can see this works as you intended (minus the name change).
.

avatar laoneo
laoneo - comment - 29 Apr 2025

I would say that the name is not that important as the location, but feel free to open an issue for the name update. Not sure how to solve this as it would require the same logic as with the location which would be another two queries. Can you mark in the tracker your test as successful? So we can move on with this one.

avatar StefanSTS StefanSTS - test_item - 29 Apr 2025 - Tested successfully
avatar StefanSTS
StefanSTS - comment - 29 Apr 2025

I have tested this item ✅ successfully on 16fab56


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

avatar laoneo
laoneo - comment - 5 May 2025

@degobbis can you give this one another test? So we can set it to RTC.

avatar degobbis
degobbis - comment - 5 May 2025

@laoneo Is the test OK if only one update server is used?
I don't have any extensions to test with more than one.

avatar laoneo
laoneo - comment - 5 May 2025

Stefan tested with multiple locations, so it would be very good to have a test also with one location in the extension manifest.

avatar degobbis degobbis - test_item - 5 May 2025 - Tested successfully
avatar degobbis
degobbis - comment - 5 May 2025

I have tested this item ✅ successfully on 07323bb

Tested only with one updateserver, but works as expected.


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

avatar laoneo laoneo - change - 5 May 2025
Status Pending Ready to Commit
avatar laoneo
laoneo - comment - 5 May 2025

rtc


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

avatar QuyTon QuyTon - alter_testresult - 5 May 2025 - StefanSTS: Tested successfully
avatar laoneo laoneo - change - 12 May 2025
Labels Added: RTC
avatar rdeutz rdeutz - close - 12 May 2025
avatar rdeutz rdeutz - merge - 12 May 2025
avatar rdeutz rdeutz - change - 12 May 2025
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2025-05-12 12:42:31
Closed_By rdeutz
avatar rdeutz
rdeutz - comment - 12 May 2025

Thanks

Add a Comment

Login with GitHub to post a comment