Feature RTC PR-6.0-dev Pending

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
14 Jul 2024

Summary of Changes

This is an effort to remove deprecated code from the system. The Updater class depends on the Adapter class, which in turn has been deprecated for a long time already. This PR removes the code of the Adapter class from the Updater class and replaces it with some sane methods to add adapters when required.

This PR does some cleanup and it adds the following methods:

  • loadAdapters(): This iterates over the set folder and adds all files it finds as available updater adapters. To keep it light, the array only contains the name as key and either the class name as value or an object. The object is instantiated just in time when needed.
  • getAdapters(): This method keeps the behavior of the $custom parameter, but otherwise still just returns the list of available adapters
  • getAdapter(): This new method replaces loadAdapter() and either returns an object which was previously made or instantiates it from the class stored in the $adapters array.
  • setAdapter(): This new method allows to hand in a name for the adapter and either a class name or an instantiated object for the respective adapter type. This would allow you to add custom adapter types and also to overwrite existing adapter types.

I reused some method names from the Adapter class. This PR is a b/c break and thus targeted towards 6.0. This is the corresponding PR to #43792 for the Updater classes.

Testing Instructions

Install an old version of an extension and then run an update for it, both via the normal extension updater and by installing a newer package over the old one. This should work the same both before and after applying the change.

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: joomla/Manual#301

  • No documentation changes for manual.joomla.org needed

avatar Hackwar Hackwar - open - 14 Jul 2024
avatar Hackwar Hackwar - change - 14 Jul 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 14 Jul 2024
Category Libraries
avatar Hackwar Hackwar - change - 15 Jul 2024
Labels Added: PR-6.0-dev
avatar Hackwar Hackwar - change - 24 Aug 2024
The description was changed
avatar Hackwar Hackwar - edited - 24 Aug 2024
avatar Bodge-IT
Bodge-IT - comment - 12 Feb 2025

@Hackwar, sorry Hannes more conflicts need fixing. If we can sort this and #43792, we can merge #43794.

avatar Hackwar Hackwar - change - 14 Feb 2025
Labels Added: Feature
avatar Bodge-IT
Bodge-IT - comment - 19 Feb 2025

@Hackwar Is this still relevant?

avatar Hackwar
Hackwar - comment - 19 Feb 2025

Yes, this is still a necessary PR.

avatar Hackwar Hackwar - change - 19 Apr 2025
The description was changed
avatar Hackwar Hackwar - edited - 19 Apr 2025
avatar Bodge-IT
Bodge-IT - comment - 6 Jun 2025

...Awaiting capability to run updater

avatar Hackwar
Hackwar - comment - 10 Jun 2025

@muhme @Bodge-IT the PR is ready. Could you two test this? Since you already tested the other PR...

avatar muhme muhme - test_item - 12 Jun 2025 - Tested successfully
avatar muhme
muhme - comment - 12 Jun 2025

I have tested this item ✅ successfully on 0fbb612

Tested before PR with JBT, current 6.0-dev branch, PHP 8.4.7, enabled 'Log Almost Everything' and 'Log Deprecated API'

  • Installed module zitat-service.de version 2.0.1 from URL https://github.com/muhme/quote_joomla/releases/download/2.0.1/mod_zitat_service_de_2.0.1.zip, configured and checked it is working
  • Update 2.0.3 is shown as available (this needs targetplatform version 6 for the module), updated, checked version is updated in administrator backend and file system XML and checked is still working
  • Uninstalled the module and installed again 2.0.1 with file upload, configured and checked is working
  • Installed over by 'Upload Package File' with 2.0.3 ZIP, checked version is updated in administrator backend and file system XML and checked is still working

Installed 60 joomla-cms-43793, PHP 8.4.7, enabled 'Log Almost Everything' and 'Log Deprecated API'

  • Installed module zitat-service.de version 2.0.1 from URL https://github.com/muhme/quote_joomla/releases, configured and checked it is working
  • ✅ Update 2.0.3 is shown as available, updated, checked version is updated in administrator backend and file system XML and checked is still working
  • Uninstalled the module and installed again 2.0.1 with file upload, configured and checked is working
  • ✅ Installed over by 'Upload Package File' with 2.0.3 ZIP, checked version is updated in administrator backend and file system XML and checked is still working
  • Uninstalled the module and installed again 2.0.1, configured and checked is working
  • ✅ Installed over by 'Install from URL' with https://github.com/muhme/quote_joomla/releases/download/2.0.3/mod_zitat_service_de_2.0.3.zip, checked version is updated in administrator backend and file system XML and checked is still working
  • Uninstalled the module and installed again 2.0.1, configured and checked is working
  • ✅ Installed over by 'Install from Folder', checked version is updated in administrator backend and file system XML and checked is still working
  • Uninstalled the module and installed 2.0.1 with CLI, configured and checked is working
docker exec jbt-60 php cli/joomla.php extension:install --path /var/www/html/tmp/mod_zitat_service_de_2.0.1.zip
  • Installed over with CLI, checked version is updated in administrator backend and file system XML and checked is still working
docker exec jbt-60 php cli/joomla.php extension:install --path /var/www/html/tmp/mod_zitat_service_de_2.0.3.zip
  • ✅ no errors in administrator/logs/everything.php
  • the ~170'000 messages in administrator/logs/deprectaed.php search case independent for updat results in following, please check by your own:
$ grep -i updat joomla-60/administrator/logs/deprecated.php 
2025-06-12T09:08:46+00:00	WARNING 10.0.0.1	deprecated	Use method "getUrl" for value pre-processing is deprecated, and will not work in Joomla 6. Use "onGetUrl" instead. Event Joomla\CMS\Event\Installer\BeforeUpdateSiteDownloadEvent - [ROOT]/libraries/src/Event/AbstractEvent.php - Line 168
2025-06-12T09:08:46+00:00	WARNING 10.0.0.1	deprecated	Use method "getHeaders" for value pre-processing is deprecated, and will not work in Joomla 6. Use "onGetHeaders" instead. Event Joomla\CMS\Event\Installer\BeforeUpdateSiteDownloadEvent - [ROOT]/libraries/src/Event/AbstractEvent.php - Line 168
2025-06-12T09:09:28+00:00	WARNING 10.0.0.1	deprecated	Use method "getUrl" for value pre-processing is deprecated, and will not work in Joomla 6. Use "onGetUrl" instead. Event Joomla\CMS\Event\Installer\BeforeUpdateSiteDownloadEvent - [ROOT]/libraries/src/Event/AbstractEvent.php - Line 168
2025-06-12T09:09:28+00:00	WARNING 10.0.0.1	deprecated	Use method "getHeaders" for value pre-processing is deprecated, and will not work in Joomla 6. Use "onGetHeaders" instead. Event Joomla\CMS\Event\Installer\BeforeUpdateSiteDownloadEvent - [ROOT]/libraries/src/Event/AbstractEvent.php - Line 168
2025-06-12T09:09:28+00:00	WARNING 10.0.0.1	deprecated	Use method "getUrl" for value pre-processing is deprecated, and will not work in Joomla 6. Use "onGetUrl" instead. Event Joomla\CMS\Event\Installer\BeforeUpdateSiteDownloadEvent - [ROOT]/libraries/src/Event/AbstractEvent.php - Line 168
2025-06-12T09:09:28+00:00	WARNING 10.0.0.1	deprecated	Use method "getHeaders" for value pre-processing is deprecated, and will not work in Joomla 6. Use "onGetHeaders" instead. Event Joomla\CMS\Event\Installer\BeforeUpdateSiteDownloadEvent - [ROOT]/libraries/src/Event/AbstractEvent.php - Line 168
2025-06-12T09:09:28+00:00	WARNING 10.0.0.1	deprecated	Use method "getUrl" for value pre-processing is deprecated, and will not work in Joomla 6. Use "onGetUrl" instead. Event Joomla\CMS\Event\Installer\BeforeUpdateSiteDownloadEvent - [ROOT]/libraries/src/Event/AbstractEvent.php - Line 168
2025-06-12T09:09:28+00:00	WARNING 10.0.0.1	deprecated	Use method "getHeaders" for value pre-processing is deprecated, and will not work in Joomla 6. Use "onGetHeaders" instead. Event Joomla\CMS\Event\Installer\BeforeUpdateSiteDownloadEvent - [ROOT]/libraries/src/Event/AbstractEvent.php - Line 168
2025-06-12T09:19:15+00:00	WARNING 10.0.0.1	deprecated	Use method "getUrl" for value pre-processing is deprecated, and will not work in Joomla 6. Use "onGetUrl" instead. Event Joomla\CMS\Event\Installer\BeforeUpdateSiteDownloadEvent - [ROOT]/libraries/src/Event/AbstractEvent.php - Line 168
2025-06-12T09:19:15+00:00	WARNING 10.0.0.1	deprecated	Use method "getHeaders" for value pre-processing is deprecated, and will not work in Joomla 6. Use "onGetHeaders" instead. Event Joomla\CMS\Event\Installer\BeforeUpdateSiteDownloadEvent - [ROOT]/libraries/src/Event/AbstractEvent.php - Line 168

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43793.
avatar Hackwar
Hackwar - comment - 12 Jun 2025

Thank you for testing. As far as I can see, none of the warnings you got are related to this PR, right?

avatar muhme
muhme - comment - 12 Jun 2025

Thank you for testing. As far as I can see, none of the warnings you got are related to this PR, right?

It seems so, as the deprecations are from different files, as touched with this PR. I was uncertain how to check. I checked now again with the three file names they are touched by the PR and result is zero ✅ 👍 😄

avatar Hackwar
Hackwar - comment - 13 Jun 2025

Unfortunately I had to do one more cleanup by removing a duplicate call to getAdapter().

avatar muhme
muhme - comment - 13 Jun 2025

Unfortunately I had to do one more cleanup by removing a duplicate call to getAdapter().

Null problemo, let me know when you're done, then I'll test again – my module is now Joomla 6 ready, this was my main effort; maybe put it on DRAFT by then?

avatar Hackwar
Hackwar - comment - 13 Jun 2025

It is ready. You can test this now.

avatar muhme muhme - test_item - 13 Jun 2025 - Tested successfully
avatar muhme
muhme - comment - 13 Jun 2025

I have tested this item ✅ successfully on b0685d4

Retestet with JBT and grafted 6.0.0-alpha2-dev+pr.43793 from current prebuild packages

  • Enabled 'Log Almost Everything' and 'Log Deprecated API'
  • Followed the same procedure as in the first test with install/configure/checks/install over/checks/uninstall:
    • ✅ Update 2.0.3 is shown as available, updated
    • ✅ Installed over by 'Upload Package File' with 2.0.3 ZIP
    • ✅ Installed over by 'Install from URL'
    • ✅ Installed over by 'Install from Folder'
    • ✅ Installed over with CLI, using file package
    • ✅ Installed over with CLI, using URL
    • ✅ no errors in administrator/logs/everything.php
    • ✅ no deprecation entries for the ExtensionAdapter.php, Updater.php and UpdateAdapter.php in the ~136.000 lines
      This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43793.
avatar exlemor exlemor - test_item - 16 Jun 2025 - Tested successfully
avatar exlemor
exlemor - comment - 16 Jun 2025

I have tested this item ✅ successfully on b0685d4

I have successfully tested this.

Used JoomDonation v5.10.9 to update to JoomDonation v5.11.0, also upgraded 2 different Language Packs to latest version.
(I also tried installing a few J6 compatible apps as a test, like Regular Labs Cache Cleaner 9.60 and others)

(the Joomla Updater did NOT find the updated version of JoomDonation online, but I was able to install v5.11 on top of v5.10.9 via uploading the file)

I did NOT test over CLI or locally. I only tested via online my hosting testing environments.


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

avatar muhme
muhme - comment - 17 Jun 2025

@ exlemor Thank you for testing 👍

the Joomla Updater did NOT find the updated version of JoomDonation online

If you check the update XML https://joomdonation.com/updates/jdonation.xml, there is no 6.0 target platform, so no update is offered correctly.

avatar rdeutz rdeutz - change - 17 Jun 2025
Status Pending Ready to Commit
avatar rdeutz
rdeutz - comment - 17 Jun 2025

Thanks for testing, RTC


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

avatar Bodge-IT Bodge-IT - change - 17 Jun 2025
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2025-06-17 07:27:48
Closed_By Bodge-IT
Labels Added: RTC
avatar Bodge-IT Bodge-IT - close - 17 Jun 2025
avatar Bodge-IT Bodge-IT - merge - 17 Jun 2025
avatar Bodge-IT
Bodge-IT - comment - 17 Jun 2025

Thanks everyone, @Hackwar, @muhme & @exlemor . Great work.

avatar Hackwar
Hackwar - comment - 17 Jun 2025

I can't begin to express how happy I am that this is finally done. Thank you to all who tested, reviewed and now merged. I've been trying to fix the adapter classes during the development of 1.6 and tried again in 2.5 and 3.5. For 4.0 unfortunately I didn't get around to fixing this, but now for 6.0 we can finally get rid of this.

Add a Comment

Login with GitHub to post a comment