Controller not found Exception

Moin,

ich habe mein Backend Plugin nun soweit, dass ich eine Fehlermeldung bekomme. Angeblich wird der Backend-Controller nicht gefunden, obwohl Name usw. alles stimmig sind. Woran kann das liegen, was kann ich machen?

Danke im Voraus!

 

Hier nun die Fehlermeldung

'Enlight_Controller_Exception' with message 'Controller "ComviAcMoney" not found' in /Applications/XAMPP/xamppfiles/htdocs/install_5/engine/Library/Enlight/Controller/Dispatcher/Default.php:486 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/install_5/engine/Library/Enlight/Controller/Front.php(226): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp)) #1 /Applications/XAMPP/xamppfiles/htdocs/install_5/engine/Shopware/Kernel.php(153): Enlight_Controller_Front->dispatch() #2 /Applications/XAMPP/xamppfiles/htdocs/install_5/vendor/symfony/http-kernel/HttpCache/HttpCache.php(492): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #3 /Applications/XAMPP/xamppfiles/htdocs/install_5/engine/Shopware/Components/HttpCache/AppCache.php(255): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL) #4 /Applications/XAMPP/xamppfiles/htdocs/install_5/vendor/symfony/http-kernel/HttpCache/HttpCache.php(263): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true) #5 /Applications/XAMPP/xamppfiles/htdocs/install_5/engine/Shopware/Components/HttpCache/AppCache.php(103): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true) #6 /Applications/XAMPP/xamppfiles/htdocs/install_5/shopware.php(101): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request)) #7 {main}

 

Hi,

wie und wo registrierst du den Controller den? Ggf. musst du das Plugin nach dem Hinzufügen des registerController / subscribeEvent neu installieren.

Daniel

Hier mal ein Teil der Bootstrap.php - da muss das doch passieren oder?

Kannst Du da irgendwas erkennnen?

 

";
			echo $msg;
			print_r($data);
			echo "

"; echo "


“; } } /** * Standard Shopware Plugin Class */ class Shopware_Plugins_Frontend_ComviAcMoney_Bootstrap extends Shopware_Components_Plugin_Bootstrap { /** * register plugin namespaces */ public function registerNamespace() { static $done = false; if(!$done) { $done = true; Shopware()->Loader()->registerNamespace(‘Shopware’, dirname(__FILE__) . ‘/’); } } /** * Returns the meta information about the plugin. * @return array */ public function getCapabilities() { return array( ‘install’ => true, ‘enable’ => true, ‘update’ => true ); } /** * Plugin install method */ public function install() { $this->checkLicense(); if(!$this->assertVersionGreaterThen(“4.3.0”)) throw new Enlight_Exception(“This Plugin needs min shopware 4.3.0”); $this->createMenu(); $this->createSnippets(); $this->createForm(); $this->subscribeEvents(); $this->createTables(); return array(‘success’ => true, ‘invalidateCache’ => array(‘config’, ‘frontend’, ‘backend’, ‘proxy’)); } /** * Plugin update method */ public function update($oldVersion) { switch($oldVersion) { default: return false; } return true; } /** * Plugin uninstall method */ public function uninstall() { $this->registerCustomModels(); $em = $this->Application()->Models(); $tool = new \Doctrine\ORM\Tools\SchemaTool($em); $classes = array($em->getClassMetadata(‘Shopware\CustomModels\ComviAcMoney\ComviAcMoneyConfig’)); $tool->dropSchema($classes); Shopware()->Db()->exec(‘DELETE FROM s_core_snippets WHERE namespace=“engine/Shopware/Plugins/Local/Frontend/ComviAcMoney/Views/frontend/plugins/comvi_ac_money/default/steps”’); Shopware()->Db()->exec(‘DELETE FROM s_core_snippets WHERE namespace=“engine/Shopware/Plugins/Local/Frontend/ComviAcMoney/Views/frontend/plugins/comvi_ac_money/responsive/steps”’); Shopware()->Db()->exec(‘DELETE FROM s_core_snippets WHERE namespace=“engine/Shopware/Plugins/Community/Frontend/ComviAcMoney/Views/frontend/plugins/comvi_ac_money/default/steps”’); Shopware()->Db()->exec(‘DELETE FROM s_core_snippets WHERE namespace=“engine/Shopware/Plugins/Community/Frontend/ComviAcMoney/Views/frontend/plugins/comvi_ac_money/responsive/steps”’); //TODO Artikel anlegen/löschen klappt im Installationsprozess nicht - PART B //$this->removeAmiciCardArticle(); return array(‘success’ => true, ‘invalidateCache’ => array(‘config’, ‘frontend’, ‘backend’, ‘proxy’)); } /** * activates the plugin */ public function enable() { $this->checkLicense(); Shopware()->Db()->exec(‘UPDATE s_core_menu SET active=1 WHERE name = “ACmoney”’); return true; } /** * deactivates the plugin */ public function disable() { Shopware()->Db()->exec(‘UPDATE s_core_menu SET active=0 WHERE name = “ACmoney”’); return true; } public function getLabel() { return ‘ACmoney’; } public function getVersion() { return ‘4.01.01’; } public function getInfo() { return array ( ‘version’ => $this->getVersion(), ‘autor’ => ‘Uwe Heldt’, ‘copyright’ => ‘Uwe Heldt’, ‘label’ => $this->getLabel(), ‘support’ => ‘http://www.uweheldt.de’, ‘link’ => ‘http://www.uweheldt.de’ ); } /** * create menu entries for this plugin */ protected function createMenu() { $parent = $this->createMenuItem(array ( ‘label’ => ‘ACmoney’, ‘controller’ => ‘ComviAcMoney’, ‘class’ => ‘sprite-credit-cards’, ‘action’ => ‘index’, ‘active’ => 1, ‘parent’ => $this->Menu()->findOneBy(‘label’, ‘Marketing’) )); } /** * create snippets for the frontend */ protected function createSnippets() { $result = Shopware()->Db()->fetchAll(” SELECT DISTINCT s.shopID as id, l.locale FROM s_core_snippets s, s_core_locales l WHERE l.id = s.localeID “); foreach($result as $ShopLocale) { $localeID = Shopware()->Db()->fetchOne('SELECT id FROM s_core_locales WHERE locale=”’.$ShopLocale[‘locale’].’"’); $sqlA = ‘INSERT INTO s_core_snippets (namespace, name, localeID, shopID, value, created, updated) VALUES (“engine/Shopware/Plugins/Local/Frontend/ComviAcMoney/Views/frontend/plugins/comvi_ac_money/default/steps”, ?, "’.$localeID.’", “’.$ShopLocale[‘id’].’”, ?, NOW(), NOW())’; $sqlAA = ‘INSERT INTO s_core_snippets (namespace, name, localeID, shopID, value, created, updated) VALUES (“engine/Shopware/Plugins/Community/Frontend/ComviAcMoney/Views/frontend/plugins/comvi_ac_money/default/steps”, ?, "’.$localeID.’", “’.$ShopLocale[‘id’].’”, ?, NOW(), NOW())’; $sqlB = ‘INSERT INTO s_core_snippets (namespace, name, localeID, shopID, value, created, updated) VALUES (“engine/Shopware/Plugins/Local/Frontend/ComviAcMoney/Views/frontend/plugins/comvi_ac_money/responsive/steps”, ?, "’.$localeID.’", “’.$ShopLocale[‘id’].’”, ?, NOW(), NOW())’; $sqlBB = ‘INSERT INTO s_core_snippets (namespace, name, localeID, shopID, value, created, updated) VALUES (“engine/Shopware/Plugins/Community/Frontend/ComviAcMoney/Views/frontend/plugins/comvi_ac_money/responsive/steps”, ?, "’.$localeID.’", “’.$ShopLocale[‘id’].’”, ?, NOW(), NOW())’; Shopware()->Db()->query($sqlA, array(‘CheckoutStepAmiciCardText’, ‘ac-money’)); Shopware()->Db()->query($sqlA, array(‘CheckoutStepAmiciCardNumber’, ‘3’)); Shopware()->Db()->query($sqlA, array(‘CheckoutStepConfirmNumber’, ‘4’)); Shopware()->Db()->query($sqlAA, array(‘CheckoutStepAmiciCardText’, ‘ac-money’)); Shopware()->Db()->query($sqlAA, array(‘CheckoutStepAmiciCardNumber’, ‘3’)); Shopware()->Db()->query($sqlAA, array(‘CheckoutStepConfirmNumber’, ‘4’)); Shopware()->Db()->query($sqlB, array(‘CheckoutStepAmiciCardText’, ‘ac-money’)); Shopware()->Db()->query($sqlB, array(‘CheckoutStepAmiciCardNumber’, ‘3’)); Shopware()->Db()->query($sqlB, array(‘CheckoutStepConfirmNumber’, ‘4’)); Shopware()->Db()->query($sqlBB, array(‘CheckoutStepAmiciCardText’, ‘ac-money’)); Shopware()->Db()->query($sqlBB, array(‘CheckoutStepAmiciCardNumber’, ‘3’)); Shopware()->Db()->query($sqlBB, array(‘CheckoutStepConfirmNumber’, ‘4’)); } } protected function createForm() { $form = $this->Form(); $form->setElement(‘boolean’, ‘pluginstatus’, array(‘label’ => ‘Plugin für diesen Shop aktivieren?’, ‘required’ => true, ‘value’ => false, ‘scope’=> Shopware_Components_Form::SCOPE_SHOP)); $form->setElement(‘text’, ‘amicicard_ordernumber’, array(‘label’ => ‘Artikelnummer für die ACmoney’, ‘required’ => true, ‘value’ => ‘acmoney’, ‘scope’=> Shopware_Components_Form::SCOPE_SHOP)); $form->save(); } protected function subscribeEvents() { // Events für Backend- und Frontend-Controller $this->subscribeEvent(‘Enlight_Controller_Dispatcher_ControllerPath_Backend_ComviAcMoney’, ‘onGetControllerPathBackend’); //$this->subscribeEvent(‘Enlight_Controller_Dispatcher_ControllerPath_Frontend_ComviAcMoney’, ‘onGetControllerPathFrontend’); // Events für die zusätzliche Checkout-Seite $this->subscribeEvent(‘Enlight_Controller_Action_PreDispatch_Frontend_Checkout’, ‘onPreDispatchFrontendCheckout’); $this->subscribeEvent(‘Enlight_Controller_Action_PreDispatch_Frontend’, ‘onPreDispatchFrontend’); $this->subscribeEvent(‘Shopware_Controllers_Frontend_Checkout::finishAction::after’, ‘after_finishAction’); $this->subscribeEvent(‘Shopware_Modules_Basket_sGetBasket_AllowEmptyBasket’, ‘allow_emptyBasket’); $this->subscribeEvent(‘Shopware_Controllers_Frontend_Checkout::getBasket::after’, ‘after_getBasket’); } public function onGetControllerPathBackend(Enlight_Event_EventArgs $args) { if(!Shopware()->Plugins()->Frontend()->ComviAcMoney()->Config()->pluginstatus) return; $this->checkLicense(); //$this->registerNamespace(); $this->registerCustomModels(); $this->Application()->Template()->addTemplateDir($this->Path() . ‘Views/’); Shopware()->Log()->log(‘Hallo Uwe’ ,Zend_Log::INFO); return $this->Path() . ‘/Controllers/Backend/ComviAcMoney.php’; } public function onGetControllerPathFrontend(Enlight_Event_EventArgs $args) { if(!Shopware()->Plugins()->Frontend()->ComviAcMoney()->Config()->pluginstatus) return; $this->checkLicense(); //$this->registerNamespace(); $this->registerCustomModels(); $this->Application()->Template()->addTemplateDir($this->Path() . ‘Views/’); return $this->Path() . ‘/Controllers/Frontend/ComviAcMoney.php’; }

 

Ich hab’s. Da fehlte noch eine Kleinigkeit. Danke!!

@uweheldt schrieb:

Ich hab’s. Da fehlte noch eine Kleinigkeit. Danke!!

Und was soll jemand mit der gleichen Problematik mit dieser Aussage anfangen?