Hi there,
in OXID EE 5.3.x we were using a util class to activate modules based on
whitelist/blacklist for multiple subshops.
For OXID 6, that is not working 100% anymore, if a module defines its
own "controllers" in metadata.php, e.g.
https://github.com/OXIDprojects/oxid-module-internals
'controllers'=> [
'module_internals_metadata'=>
\OxidCommunity\ModuleInternals\Controller\Admin\Metadata::class,
'module_internals_state'=>
\OxidCommunity\ModuleInternals\Controller\Admin\State::class,
'module_internals_utils'=>
\OxidCommunity\ModuleInternals\Controller\Admin\Utils::class,
],
Now if I use this class
https://github.com/shoptimax/ioly_installer/blob/master/IolyInstallerCore.php#L450
and ModuleInstaller::activate($oModule):
/ foreach ($aShopIds as $shopId) {//
// try {//
// $oConfig->setShopId($shopId);//
// $oModule = oxNew('oxModule');//
// if ($oModule->load($sModuleId)) {//
// $oModuleCache = oxNew('oxModuleCache', $oModule);//
// $oModuleInstaller = oxNew('oxModuleInstaller',
$oModuleCache);//
//*if ($oModuleInstaller->activate($oModule)) {*/
...
to activate the module for multiple subshops, I get an *exception* after
the first subshop, e.g.
/Loaded moduleinternals module, trying to activate ...//
//Error activating module 'moduleinternals': Fehler: Modul nicht
aktiviert.<br />In einem Shop oder Sub-Shop müssen Schüssel und Werte
für "controllers" eindeutig sein.<br />Folgende Schlüssel oder Werte für
"controllers", die in der Datei metadata.php dieses Moduls definiert
sind, existieren schon im Shop:<br />
OxidCommunity\ModuleInternals\Controller\Admin\Metadata,OxidCommunity\ModuleInternals\Controller\Admin\State,OxidCommunity\ModuleInternals\Controller\Admin\Utils//
//#0 /var/www/html/demo-oxid6/source/oxfunctions.php(103):
OxidEsales\EshopCommunity\Core\UtilsObject->oxNew('OxidEsales\\Esho...')//
//#1
/var/www/html/demo-oxid6/vendor/oxid-esales/oxideshop-ce/source/Core/Module/ModuleInstaller.php(100):
oxNew('OxidEsales\\Esho...')//
//#2
/var/www/html/demo-oxid6/vendor/ioly/installer/IolyInstallerCore.php(450):
OxidEsales\EshopCommunity\Core\Module\ModuleInstaller->activate(Object(OxidCommunity\ModuleInternals\Core\Module))//
//#3
/var/www/html/demo-oxid6/vendor/ioly/installer/IolyInstallerCore.php(417):
ioly\IolyInstallerCore::activateModule('moduleinternals', '1')//
//#4
/var/www/html/demo-oxid6/vendor/ioly/installer/IolyInstallerCore.php(184):
ioly\IolyInstallerCore::activateModulesWhitelisted()//
//#5 /var/www/html/demo-oxid6/source/install.php(27):
ioly\IolyInstallerCore::run('/var/www/html/g...', false, false, false)//
//#6 {main}/
So it seems to work for the first subshop, but then the check for
"duplicate" controllers throws an Exception.
Any idea how to fix this? It seems that the ModuleInstaller isn't aware
of the different subshop ... I've also tried to set the Config with e.g.
$oModuleInstaller->setConfig($oConfig);
etc., but that didn't help either.
Thanks,
Stefan
--
--
************************************
Stefan Moises
Manager Research & Development
shoptimax GmbH
Ulmenstraße 52 H
90443 Nürnberg
Tel.: 0911/25566-0
Fax: 0911/25566-29
moi...@shoptimax.de
http://www.shoptimax.de
Geschäftsführung: Friedrich Schreieck
Ust.-IdNr.: DE 814340642
Amtsgericht Nürnberg HRB 21703
************************************