No Code Attached Yet
avatar Elfangor93
Elfangor93
6 Sep 2025

Steps to reproduce the issue

  • Install fresh Joomla installation
  • Install component with the following specialities
    • Installing default content during installation using Table classes
    • Implementing own MVCFactoryProvider

Expected result

Installation successful

Actual result

PHP Error Class "Example\Component\Example\Administrator\MVC\MVCFactoryProvider" not found

System information (as much as possible)

  • Joomla! 6.0.0-beta3-dev
  • PHP version 8.3.14
  • MySQL version 9.1.0

Additional comments

If you have an extension with a custom MVCFactoryProvider, then the fully qualified class name including namespace is not available during installation. This means $app->bootComponent('com_mycomponent')->getMVCFactory()->createModel(...) does not work during postflight in the installation script.
Apparently there are core Plugins like Behaviour - Versionable who are loading the MVCFactory and are called when a Table is stored. I use Tables to install default content during component installation.

To reproduce the error you can use the JoomGallery extension:
https://github.com/JoomGalleryfriends/JoomGallery/actions/runs/17437007533/artifacts/3917471538

avatar Elfangor93 Elfangor93 - open - 6 Sep 2025
avatar joomla-cms-bot joomla-cms-bot - change - 6 Sep 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 6 Sep 2025
avatar Elfangor93 Elfangor93 - change - 6 Sep 2025
The description was changed
avatar Elfangor93 Elfangor93 - edited - 6 Sep 2025
avatar rdeutz
rdeutz - comment - 7 Sep 2025

Could you post the full error stack, please.

avatar Fedik
Fedik - comment - 7 Sep 2025

You trying to run the code before the installations is finished and before namespace map is updated.
The new namespace map going to be available on next after installation request.

If you really want it during installation then you have to do registration manually. The installer cannot do it on its own for many reasons.

avatar Elfangor93
Elfangor93 - comment - 8 Sep 2025

An error has occurred.

0 Class "Joomgallery\Component\Joomgallery\Administrator\MVC\MVCFactoryProvider" not found

Call Stack

# Function Location
1 () JROOT\administrator\components\com_joomgallery\services\provider.php:50
2 Joomla\DI\ServiceProviderInterface@anonymousC:\wamp64\www\j6jg4-dev\administrator\components\com_joomgallery\services\provider.php:37$b1f->register() JROOT\libraries\src\Extension\ExtensionManagerTrait.php:145
3 Joomla\CMS\Application\CMSApplication->loadExtension() JROOT\libraries\src\Extension\ExtensionManagerTrait.php:51
4 Joomla\CMS\Application\CMSApplication->bootComponent() JROOT\plugins\behaviour\versionable\src\Extension\Versionable.php:110
5 Joomla\Plugin\Behaviour\Versionable\Extension\Versionable->onTableAfterStore() JROOT\libraries\vendor\joomla\event\src\Dispatcher.php:454
6 Joomla\Event\Dispatcher->dispatch() JROOT\libraries\src\Table\Nested.php:858
7 Joomla\CMS\Table\Nested->store() JROOT\administrator\components\com_joomgallery\src\Table\MultipleAssetsTable.php:114
8 Joomgallery\Component\Joomgallery\Administrator\Table\MultipleAssetsTable->store() JROOT\administrator\components\com_joomgallery\src\Table\CategoryTable.php:312
9 Joomgallery\Component\Joomgallery\Administrator\Table\CategoryTable->store() JROOT\tmp\joomgallery\script.php:666
10 com_joomgalleryInstallerScript->addDefaultCategory() JROOT\tmp\joomgallery\script.php:454
11 com_joomgalleryInstallerScript->postflight() JROOT\libraries\src\Installer\LegacyInstallerScript.php:159
12 Joomla\CMS\Installer\LegacyInstallerScript->__call() JROOT\libraries\src\Installer\LegacyInstallerScript.php:188
13 Joomla\CMS\Installer\LegacyInstallerScript->callOnScript() JROOT\libraries\src\Installer\LegacyInstallerScript.php:114
14 Joomla\CMS\Installer\LegacyInstallerScript->postflight() JROOT\libraries\src\Installer\InstallerAdapter.php:1064
15 Joomla\CMS\Installer\InstallerAdapter->triggerManifestScript() JROOT\libraries\src\Installer\InstallerAdapter.php:802
16 Joomla\CMS\Installer\InstallerAdapter->install() JROOT\libraries\src\Installer\Installer.php:688
17 Joomla\CMS\Installer\Installer->install() JROOT\administrator\components\com_installer\src\Model\InstallModel.php:215
18 Joomla\Component\Installer\Administrator\Model\InstallModel->install() JROOT\administrator\components\com_installer\src\Controller\InstallController.php:52
19 Joomla\Component\Installer\Administrator\Controller\InstallController->install() JROOT\libraries\src\MVC\Controller\BaseController.php:730
20 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT\libraries\src\Dispatcher\ComponentDispatcher.php:143
21 Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() JROOT\libraries\src\Component\ComponentHelper.php:361
22 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT\libraries\src\Application\AdministratorApplication.php:150
23 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT\libraries\src\Application\AdministratorApplication.php:205
24 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT\libraries\src\Application\CMSApplication.php:315
25 Joomla\CMS\Application\CMSApplication->execute() JROOT\administrator\includes\app.php:58
26 require_once() JROOT\administrator\index.php:32
avatar Elfangor93
Elfangor93 - comment - 8 Sep 2025

Based on the call stack, you can see that the error is thrown at

$this->getDispatcher()->dispatch('onTableAfterStore', $event);

The plugin which is in the end causing the error is the plg_behaviour_versionable as it tries to boot the component which is currently being installed.

$model = $this->getApplication()->bootComponent($component)->getMVCFactory()->createModel($modelName, 'Administrator');

During the booting the custom MVCFactoryProvider is not found because the namespace of this component is not yet available.

This all leads to the fact that installing default content using the table classes is not possible anymore in Joomla! 6 within the postflight method of the installation.

avatar Elfangor93 Elfangor93 - change - 8 Sep 2025
The description was changed
avatar Elfangor93 Elfangor93 - edited - 8 Sep 2025

Add a Comment

Login with GitHub to post a comment