\Joomla\CMS\Extension\Service\Provider\MVCFactory is not able to get an individual Database from a Component-Container because of:
if ($factory instanceof DatabaseAwareInterface) {
$factory->setDatabase($container->get(DatabaseInterface::class));
}
in Version 6.2.0. Only the CMS-Database (from parent container) is used.
Adding \Joomla\Database\DatabaseAwareInterface to \Joomla\CMS\MVC\Factory\MVCFactory-Implements resolves the problem in Version 6.2.0. As a workaround in my Components using its own database I use the following code to set the database in provider.php:
$container->extend(
MVCFactoryInterface::class,
function (MVCFactoryInterface $factory, Container $c) {
$factory->setDatabase($c->get(\Joomla\Database\DatabaseInterface::class));
return $factory;
}
);
see also my Comments in [#45060]
| Labels |
Removed:
?
|
||
| Labels |
Added:
No Code Attached Yet
|
||