Success

User tests: Successful: Unsuccessful:

avatar tejaschavan724
tejaschavan724
21 Oct 2026

Pull Request resolves #48530.

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

When upgrading from Joomla 5.4 to Joomla 6.1 (notably via CLI e.g. php cli/joomla.php core:update), the Joomla 6 archive is extracted onto disk, which deploys the new Joomla 6 libraries/src/Installer/Installer.php.

During the finalization phase, the in-memory Joomla 5.4 updater (administrator/components/com_joomlaupdate/src/Model/UpdateModel.php line 946) invokes:

$installer->setAdapter($installer->extension->type);

In Joomla 5, Adapter::setAdapter($name, &$adapter = null) accepted a single argument and resolved the adapter class by name.
However, in Joomla 6 (#43792), Installer::setAdapter($name, $adapter) made $adapter a required parameter with no default value.

When the updater calls setAdapter($name) with only one argument, PHP throws a fatal error:

ArgumentCountError: Too few arguments to function Joomla\CMS\Installer\Installer::setAdapter(), 1 passed and exactly 2 expected

This PR makes $adapter optional ($adapter = null) in Installer::setAdapter():

  • If $adapter === null:
    • If the adapter is already registered in $this->adapters, it returns true.
    • Otherwise, it resolves the class by conventional name ($this->classprefix . ucfirst($name) . 'Adapter') and registers it.
  • If $adapter is provided (object or class name string), it sets it as before.

This ensures seamless backwards compatibility for transitions from Joomla 5 to Joomla 6 without breaking the new Joomla 6 architecture.

Testing Instructions

  1. On a Joomla 6.1 instance, verify calling $installer->setAdapter('file') with a single argument succeeds without throwing an ArgumentCountError.
  2. Verify calling $installer->setAdapter('custom', CustomAdapter::class) or $installer->setAdapter('custom', $adapterObject) continues to work as expected.
  3. Test a Joomla 5.4 to 6.1 update via CLI (php cli/joomla.php core:update) and verify the update completes the finalisation phase without halting on setAdapter().

Actual result BEFORE applying this Pull Request

The update fails with:
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Joomla\CMS\Installer\Installer::setAdapter(), 1 passed .../administrator/components/com_joomlaupdate/src/Model/UpdateModel.php on line 946 and exactly 2 expected

Expected result AFTER applying this Pull Request

The update completes successfully without argument count errors.

Link to documentations

Please select:

  • No documentation changes for guide.joomla.org needed
  • No documentation changes for manual.joomla.org needed
avatar tejaschavan724 tejaschavan724 - open - 21 Oct 2026
avatar tejaschavan724 tejaschavan724 - close - 22 Oct 2026

Add a Comment

Login with GitHub to post a comment