RTC PR-6.0-dev Pending

User tests: Successful: Unsuccessful:

avatar conseilgouz
conseilgouz
1 Jul 2025

Pull Request for Issue #45653 .

Summary of Changes

During extension installation, when calling Installer, Database not set in Joomla\CMS\Installer\Installer error is displayed

Testing Instructions

Install an extension that calls Installer function, like https://www.joomlack.fr/en/joomla-extensions/page-builder-ck

Actual result BEFORE applying this Pull Request

Installation fails with Database not set in Joomla\CMS\Installer\Installer error

Expected result AFTER applying this Pull Request

Installation is OK

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 conseilgouz conseilgouz - open - 1 Jul 2025
avatar conseilgouz conseilgouz - change - 1 Jul 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Jul 2025
Category Libraries
avatar conseilgouz
conseilgouz - comment - 1 Jul 2025

Note : in J5.3, setDatabase was performed in Adapter construct function.
That's missing in the new Installer construct function.

avatar conseilgouz conseilgouz - change - 1 Jul 2025
Labels Added: PR-6.0-dev
avatar conseilgouz conseilgouz - change - 1 Jul 2025
The description was changed
avatar conseilgouz conseilgouz - edited - 1 Jul 2025
avatar conseilgouz
conseilgouz - comment - 1 Jul 2025

PR #43792 replaces parent::__construct call by its local calls. $this->db is missing from the new code.

avatar conseilgouz
conseilgouz - comment - 1 Jul 2025

In #43792, libraries/src/Console/ExtensionInstallCommande.php has 2 calls to Installer (line 151 and line 184).

I think that setDatabase lines (152 and 185) are not required anymore as this will be done in Installer.php construct function (if this PR is accepted).

avatar bcordis bcordis - test_item - 7 Aug 2025 - Tested successfully
avatar bcordis
bcordis - comment - 7 Aug 2025

I have tested this item ✅ successfully on e57a3b4

Joomla 6.0.0-Alpha 3 PHP 8.3.14 Completed Successful

The install component fails without the patch.


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

avatar conseilgouz
conseilgouz - comment - 7 Aug 2025

Thank you @bcordis
One more to go and this could become RTC...

avatar Elfangor93 Elfangor93 - test_item - 9 Aug 2025 - Tested successfully
avatar Elfangor93
Elfangor93 - comment - 9 Aug 2025

I have tested this item ✅ successfully on e57a3b4

Joomla 6.0.0-alpha4-dev, PHP 8.3.24, MySQL 8.4.0

Installation of extension successfully installed which fails without the patch.


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

avatar conseilgouz
conseilgouz - comment - 9 Aug 2025

Thank you @Elfangor93.
Let's wait for @rdeutz 's review.

avatar richard67
richard67 - comment - 15 Aug 2025

@conseilgouz Not a good idea to use the branch update button when a PR has successful human tests because this resets the test counter, and if that PR has 2 tests and not RTC yet, it might get lost. I will restore the test counter now. But keep it in mind for the next time.

avatar richard67 richard67 - alter_testresult - 15 Aug 2025 - bcordis: Tested successfully
avatar richard67 richard67 - alter_testresult - 15 Aug 2025 - Elfangor93: Tested successfully
avatar richard67 richard67 - change - 15 Aug 2025
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 15 Aug 2025

RTC


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

avatar conseilgouz
conseilgouz - comment - 16 Aug 2025

Thank you @richard67

No comment about : #45670 (comment) ?

Pascal

avatar richard67
richard67 - comment - 16 Aug 2025

Thank you @richard67

No comment about : #45670 (comment) ?

Pascal

@Hackwar Could you check that? Thanks in advance.

avatar richard67 richard67 - change - 16 Aug 2025
Labels Added: RTC
avatar Hackwar
Hackwar - comment - 16 Aug 2025

I understand what you are trying to do here, but I don't think it is right. The goal is to inject the database object from the outside. Now however you are always fetching it from the container. This is actually a step backwards and you might as well just use Factory::getDbo() instead. If you are creating your own Installer instance, you also have to do the proper setup and inject the database object into it. I'm also not sure if this is a new issue, since the same was necessary in J5 already as well. I wouldn't merge this PR.

avatar conseilgouz
conseilgouz - comment - 17 Aug 2025

This PR is to fix issue #45653 : some extensions installation/update won't work in J6.0 without this PR (Joomgallery, pagebuilderCK, ... and one of my onw).

As stated in #45653 (comment) , it could be fixed by adding a note in installation documentation, but who reads it.

avatar Hackwar
Hackwar - comment - 17 Aug 2025

The code in the past which allowed this was https://github.com/joomla/joomla-cms/blob/5.3-dev/libraries/src/Adapter/Adapter.php#L92
As I wrote, this is actually expected behavior. We want injection and if we want to actually make this a reality, we have to break this at some point. The commit introducing this into the Installer was here: #37625

avatar Elfangor93
Elfangor93 - comment - 17 Aug 2025

Whats the difference between injectibg the DB object by myself or take it automatically from the Container if its not yet set?

As far as I see, I could still inject my own instance..

Add a Comment

Login with GitHub to post a comment