FAQ - Häufig gestellte Fragen - Shopware 4

core.ERROR: exception ‚Enlight_Controller_Exception‘ with message ‚Action „Frontend_***_***Action“ not found failure‘ in /…/Controller/Action.php:389 Immer mal wieder kommt es vor, dass insbesondere Suchmaschinen nicht vorhandene Seiten eures Shop aufrufen. In manchen Fällen werden dabei ungültige request an standard Shopware controller gesendet - was wiederum dazu führt, dass eure error logs mit Fehlermeldungen geflutet werden oder ihr (je nach Konfiguration) entsprechende Emails bekommt. Ein möglicher stack trace: #0 .../engine/Library/Enlight/Controller/Action.php(159): Enlight\_Controller\_Action-\>\_\_call('olcwhatispaypal...', Array) #1 .../engine/Library/Enlight/Controller/Action.php(159): Shopware\_Proxies\_ShopwareControllersFrontendListingProxy-\>olcwhatispaypalAction() #2 .../engine/Library/Enlight/Controller/Dispatcher/Default.php(528): Enlight\_Controller\_Action-\>dispatch('olcwhatispaypal...') #3 .../engine/Library/Enlight/Controller/Front.php(228): Enlight\_Controller\_Dispatcher\_Default-\>dispatch(Object(Enlight\_Controller\_Request\_RequestHttp), Object(Enlight\_Controller\_Response\_ResponseHttp)) #4 .../engine/Shopware/Kernel.php(141): Enlight\_Controller\_Front-\>dispatch() #5 .../vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(472): Shopware\Kernel-\>handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #6 .../engine/Shopware/Components/HttpCache/AppCache.php(256): Symfony\Component\HttpKernel\HttpCache\HttpCache-\>forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL) #7 .../vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(429): Shopware\Components\HttpCache\AppCache-\>forward(Object(Symfony\Component\HttpFoundation\Request), true) #8 .../vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(329): Symfony\Component\HttpKernel\HttpCache\HttpCache-\>fetch(Object(Symfony\Component\HttpFoundation\Request), true) #9 .../engine/Shopware/Components/HttpCache/AppCache.php(178): Symfony\Component\HttpKernel\HttpCache\HttpCache-\>lookup(Object(Symfony\Component\HttpFoundation\Request), true) #10 .../vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/HttpCache.php(193): Shopware\Components\HttpCache\AppCache-\>lookup(Object(Symfony\Component\HttpFoundation\Request), true) #11 .../engine/Shopware/Components/HttpCache/AppCache.php(113): Symfony\Component\HttpKernel\HttpCache\HttpCache-\>handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #12 .../shopware.php(109): Shopware\Components\HttpCache\AppCache-\>handle(Object(Symfony\Component\HttpFoundation\Request)) #13 {main} Einen ähnlichen Fehler könnt ihr live im Shopware Demoshop reproduzieren: http://www.shopwaredemo.de/listing/olcwhatispaypal Prinzipiell stellen diese Fehlermeldungen zwar kein Problem oder gar ein Sicherheitsrisiko dar, dennoch ist es in Ausnahmefällen sinnvoll diese Fehlermeldungen zu unterdrücken. Sobald Suchmaschinen eine ungültige URL gefunden haben, wird diese immer wieder besucht. Da es sich in der Regel um die gleiche URL handelt, können wir uns über ein Plugin vor den angesprochenen controller setzen und nur gültige actions zulassen. Alle übrigen (=ungültigen) Anfragen leiten wir einfach kommentarlos weiter. Am Beispiel des detail controllers: /\*\* \* Install the plugin and subscribe the pre dispatch event of the detail controller. \* \* @return boolean \*/ public function install() { // subscribe the pre dispatch event of the detail controller $this-\>subscribeEvent( 'Enlight\_Controller\_Action\_PreDispatch\_Frontend\_Detail', 'onDetailPreDispatch' ); // installation successful return true; } /\*\* \* Our event method to redirect invalid actions. \* \* @param Enlight\_Event\_EventArgs $arguments \* \* @return void \*/ public function onDetailPreDispatch( Enlight\_Event\_EventArgs $arguments ) { // get the detail controller /\* @var $controller Shopware\_Controllers\_Frontend\_Detail \*/ $controller = $arguments-\>getSubject(); // is this a valid / known action? if ( !in\_array( strtolower( $controller-\>Request()-\>getActionName() ), array( "error", "index", "rating" ) ) ) // redirect to any other action or directly to 404 $controller-\>forward( "error" ); }

1 „Gefällt mir“