Installation successful
PHP Error Class "Example\Component\Example\Administrator\MVC\MVCFactoryProvider" not found
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
Labels |
Added:
No Code Attached Yet
|
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.
0 Class "Joomgallery\Component\Joomgallery\Administrator\MVC\MVCFactoryProvider" not found
# | 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 |
Based on the call stack, you can see that the error is thrown at
joomla-cms/libraries/src/Table/Nested.php
Line 858 in e3de1e4
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.
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.
Could you post the full error stack, please.