503 Fehler bei Programmierung eines Plugins

Hallo,

ich bin dabei, ein Plugin für den Export und Import von Bestellungen mit automatischer Änderung des Bestellstatus und Emailversand bei Export und automatischen hinzufügen einer Trackingnummer und Emailversand beim Import. 

Folgende Ordner- und Dateistruktur habe ich bisher angelegt:
 

Folgende Codes habe ich bisher geschrieben:

BigBellyWawi/BigBellyWawi.php
 

BigBellyWawi/plugin.xml

    BigBelly Wawi
    BigBelly Wawi

    1.0.0
    (c) Yves Hönicke
    MIT
    
    Yves Hönicke
    

    
        Erstveröffentlichung
        First release

BigBellyWawi//Controllers/Backend/BigBellyWawi.php

BigBellyWawi//Models/BigBellyWawi.php

BigBellyWawi//Resources/menu.xml

            BigBellyWawi
            BigBellyBank Wawi
            BigBellyBank Wawi
            BigBellyWawi
            index
            sprite-metronome
            Customer

BigBellyWawi//Resources/services.xml

BigBellyWawi//Resources/views/backend/big_belly_wawi/app.js

Ext.define('Shopware.apps.BigBellyWawi', {
    extend: 'Enlight.app.SubApplication',
 
    name:'Shopware.apps.BigBellyWawi',
 
    loadPath: '{url action=load}',
    bulkLoad: true,
 
    controllers: ['Main'],
 
    views:['main.Window','main.Settings'],
    
    models: ['BigBellyWawi'],
 
    launch: function() {
        return this.getController('Main').mainWindow;
    }
});

BigBellyWawi//Resources/views/backend/big_belly_wawi/controller/main.js

Ext.define('Shopware.apps.BigBellyWawi.controller.Main', {
    extend: 'Enlight.app.Controller',
 
    init: function() {
        var me = this;
        me.mainWindow = me.getView('main.Window').create({ }).show();
    }
});

BigBellyWawi//Resources/views/backend/big_belly_wawi/model/bigbellywawi.js

Ext.define('Shopware.apps.BigBellyWawi.model.BigBellyWawi', {
    extend: 'Shopware.data.Model',
 
    configure: function() {
        return {
            controller: 'BigBellyWawi',
            detail: 'Shopware.apps.BigBellyWawi.view.detail.Container'
        };
    }
});

BigBellyWawi//Resources/views/backend/big_belly_wawi/view/detail/container.js

Ext.define('Shopware.apps.BigBellyWawi.view.detail.Container', {
    extend: 'Shopware.model.Container',
    padding: 20,
 
    configure: function() {
        return {
        };
    }
});

BigBellyWawi//Resources/views/backend/big_belly_wawi/view/detail/window.js

Ext.define('Shopware.apps.BigBellyWawi.view.detail.Window', {
    extend: 'Shopware.window.Detail',
 
    title : 'BigBelly Wawi',
    height: 420,
    width: 900
});

BigBellyWawi//Subscribers/Wawi.php

pluginDirectory = $pluginDirectory;
    }
    
    /**
     * {@inheritdoc}
     */
    
    public static function getSubscribedEvents()
	{
        
		return [
            
			'Enlight_Controller_Action_PostDispatch_Backend_Order' => 'onBackendOrderPostDispatch'
		];
	}
    
    
    
    public function onBackendOrderPostDispatch(\Enlight_Event_EventArgs $arguments)
    {
        $controller = $args->getSubject();

        $view = $controller->View();
        $request = $controller->Request();

        $view->addTemplateDir($this->pluginDirectory . '/Resources/views');

        if ($request->getActionName() == 'index') {
            $view->extendsTemplate('backend/big_belly_wawi/app.js');
        }

        if ($request->getActionName() == 'load') {
            $view->extendsTemplate('backend/big_belly_wawi/view/detail/window.js');
        }
        
    }
}

Der Menüpunkt wird angezeigt. Wenn ich nun das Ganze aufrufen will, erhalte ich folgende Fehlermeldung:

Ups! Ein Fehler ist aufgetreten!

Die nachfolgenden Hinweise sollten Ihnen weiterhelfen.

Unable to load template snippet ‘backend/big_belly_wawi/app.js’ in engine/Library/Smarty/sysplugins/smarty_internal_templatebase.php on line 127

Stack trace:

#0 engine/Library/Enlight/View/Default.php(300): Smarty\_Internal\_TemplateBase-\>fetch()
 #1 engine/Library/Enlight/Controller/Plugins/ViewRenderer/Bootstrap.php(216): Enlight\_View\_Default-\>render(Object(Enlight\_Template\_Default))
 ... 

 



Wo liegt genau der Fehler? 



 



 

Moin @YvesHoenicke‍,

schau am Besten mal zuerst, ob der Pfad beim Aufruf von  addTemplateDir  passt.
Also der hier:

$view->addTemplateDir($this->pluginDirectory . '/Resources/views');

So wie ich das sehe, übergibst du deinem Subscriber nämlich diesen Pfad für den Konstruktor garnicht, also das $this->pluginDirectory  ist vermutlich leer.

Gruß,
Patrick  Shopware

Das passt was nicht zusammen:

\Enlight_Event_EventArgs $arguments

$controller = $args->getSubject();

 Und eventuell über Enlight_Template_Manager laden.

[@Patrick Stahl](http://forum.shopware.com/profile/1869/Patrick Stahl “Patrick Stahl”)‍

Der Pfad stimmt soweit.

@R4M‍

Den Fehler habe ich korrigiert.

Habe die Datei 

BigBellyWawi//Subscribers/Wawi.php

nochmal angepasst mit folgenden Code:

pluginDirectory = $pluginDirectory;
		$this->templateManager = $templateManager;
	}
    
    /**
     * {@inheritdoc}
     */
    
    public static function getSubscribedEvents()
	{
        
		return [
            
			'Enlight_Controller_Action_PostDispatch_Backend_Order' => 'onBackendOrderPostDispatch'
		];
	}
    
    
    
    public function onBackendOrderPostDispatch(\Enlight_Event_EventArgs $args)
    {
        $controller = $args->get('subject');

        $view = $controller->View();
        $request = $controller->Request();

        //$view->addTemplateDir($this->pluginDirectory . '/Resources/views/');
        
        $this->templateManager->addTemplateDir($this->pluginDirectory . '/Resources/views');


        if ($request->getActionName() == 'index') {
            $view->extendsTemplate('backend/big_belly_wawi/app.js');
        }

        if ($request->getActionName() == 'load') {
            $view->extendsTemplate('backend/big_belly_wawi/view/detail/window.js');
        }
        
    }

}

Dennoch erhalte ich weiterhin die oben genannte Fehlermeldung.

Irgendwie steht ich da grad aufm Schlauch und komme nicht weiter.

Hey @YvesHoenicke‍,

das klingt auf jeden Fall nach einem Fehler, den ich schnell ausmerzen könnte.
Kannst du mir das Plugin irgendwo hochladen und dann den Link dazu zukommen lassen?

Ich würde mir das dann mal 5 Minuten lokal anschauen und debuggen. Das dürfte schnell erledigt sein. :slight_smile:

Gruß,
Patrick  Shopware

Vielen Danke erstmal. Habe es als ZIP in meine Cloud gepackt. 

https://adobe.ly/2CJbwKb

Gruß

Yves

Moin @YvesHoenicke‍,

ich habe dein Plugin mal fix installiert und habe dabei die folgenden zwei Dinge festgestellt:

  1. Den TemplateManager aus deinem Subscriber habe ich wieder entfernt - den hast du deinem Subscriber momentan eh nicht über den DI Container (services.xml) übergeben und das führte bereits zu einem Fehler
  2. Du hängst dich über den Code an das  Bestellungs-Modul  - wenn du also die Bestellungen öffnest, gibt es  keine  Fehlermeldung, weil du dort alles richtig gemacht hast.
    Dieser Code wird  nur ausgeführt, wenn du das Bestellungs-Modul öffnest.
    Nicht aber, wenn du dein eigenes Modul öffnest - es kommt weiterhin zu der Fehlermeldung.

Warum?
Wenn du dein eigenes Modul öffnest, ist nie die Zeile “$view->addTemplateDir” ausgeführt worden - das wird ja nur beim Bestellungs-Modul ausgeführt!
In kurz: Wenn du die folgenden Zeilen deinem Controller anfügst, läuft es bereits - zumindest dieser spezifische Fehler ist dann gelöst:

View()->addTemplateDir( __DIR__. '/../../Resources/views');
    }
}

Du bekommst dann aber eine Folge-Fehlermeldung, die aber begründet ist: Er versucht eine Datei zu laden, die nicht existiert.
Aber ab hier kommst du bestimmt wieder selber weiter! :slight_smile:

Gruß,
Patrick  Shopware

[@Patrick Stahl](http://forum.shopware.com/profile/1869/Patrick Stahl “Patrick Stahl”)‍

Hi Patrick,

vielen vielen Dank erst einmal. Dank deiner Hilfe bin ich nun ein ganzes Stück weitergekommen. 

Ich konnte nun die Oberfläche wie gewünscht umsetzen. Allerdings funktionieren die Buttons nicht. Es wird kein Event gefeuert. Zum Testen hatte ich eine kleine Funktion geschrieben, um zu prüfen, ob die Buttons überhaupt irgendetwas machen. Leider ohne Erfolg.

Folgende Änderungen am Code habe ich vorgenommen:

BigBellyWawi//Controllers/Backend/BigBellyWawi.php

alert('$messageTest');";
    } 
}

BigBellyWawi//Resources/views/backend/big_belly_wawi/app.js

/**
 *
*/
//{namespace name="backend/big_belly_wawi/view/main"}
//{block name="backend/big_belly_wawi/application"}
Ext.define('Shopware.apps.BigBellyWawi', {
    extend: 'Enlight.app.SubApplication',
 
    name:'Shopware.apps.BigBellyWawi',
 
    loadPath: '{url action=load}',
    
    bulkLoad: true,
 
    controllers: ['Main'],
 
   // views:['main.Window'],
    
    views: [
        'main.Container',
        'main.Window',
        'main.Settings'
    ],
    
    models: ['BigBellyWawi'],
 
    launch: function() {
        return this.getController('Main').mainWindow;
    }
});
//{/block}

 

BigBellyWawi//Resources/views/backend/big_belly_wawi/view/main/settings.js

//{namespace name="backend/diw_wawi/view/main"}
//{block name="backend/diw_wawi/view/main/settings"}
Ext.define('Shopware.apps.BigBellyWawi.view.main.Settings', {
 
    extend: 'Ext.form.Panel',
    
    title:'Exportieren von Bestellungen und Kunden',
    border: false,
    flex:1,
    region:'center',
    autoHeight:true,
    bodyPadding:5,
    fieldDefaults: {
        labelWidth: 95
    },
    defaultType: 'textfield',
    
    /**
     * Called when the component will be initialed.
     */
    initComponent: function() {
        var self = this;

        self.items = [{
            xtype:'fieldset',
            title:'Export',
            items:[{
                xtype: 'container',
                layout:'hbox',
                items:[{
                    xtype:'checkbox',
                    fieldLabel: 'E-Mail nicht versenden?',
                    id:'exportFirst',
                    width:'150',
                    labelStyle: 'width:150px;padding:0;'
                },{
                    xtype: 'button',
                    width:'150',
                    margin:'0 0 0 7',
                    text : 'Export (nur offen1)',
                    cls: 'secondary small',
                    iconCls: 'sprite-document-export',
                    handler:function(){
                        //var link = '{url controller="BigBellyWawi" action="doExportAllCsv"}';
                        var link = '{url controller="BigBellyWawi" action="buttonTest"}';
                        //link+="?filter_=only_open&send_email_notification="+Ext.getCmp('exportFirst').getValue();
                        
                        self.fireEvent('exportAction',link);
                        
                    }
                }
                ]
            },{
                xtype: 'container',
                layout:'hbox',
                margin:'10 0 0 0',
                items:[{
                    xtype:'checkbox',
                    fieldLabel: 'E-Mail nicht versenden?',
                    width:'150',
                    labelStyle: 'width:150px;padding:0;',
                    id:'exportSecond'
                },{
                    xtype: 'button',
                    width:'150',
                    margin:'0 0 0 7',
                    text : 'Export (exkl. offen)',
                    cls: 'secondary small',
                    iconCls: 'sprite-document-export',
                    handler:function(){
                        var link = '{url controller="BigBellyWawi" action="doExportAllCsv"}';
                        //var secondLink = '{url controller="BigBellyWawi" action="doExportOrderCustomerCsv"}';
                        link+="?filter_=only_not_open&send_email_notification="+Ext.getCmp('exportSecond').getValue();
                       
                        self.fireEvent('exportAction',link,Ext.getCmp('exportSecond').getValue());
                        
                    }
                }
                ]
            },{
                xtype: 'container',
                layout:'hbox',
                margin:'10 0 0 0',
                items:[{
                    xtype:'checkbox',
                    fieldLabel: 'E-Mail nicht versenden?',
                    width:'150',
                    labelStyle: 'width:150px;padding:0;',
                    id:'exportThird'
                }, {
                    xtype: 'button',
                    width:'150',
                    margin:'0 0 0 7',
                    text : 'Export (alle)',
                    cls: 'secondary small',
                    iconCls: 'sprite-document-export',
                    handler:function(){
                        var link = '{url controller="BigBellyWawi" action="doExportAllCsv"}';
                        
                        link+="?send_email_notification="+Ext.getCmp('exportThird').getValue();
                        
                        self.fireEvent('exportAction',link,Ext.getCmp('exportSecond').getValue());
                       
                    }
                }
                ]
            }]
        },{
            xtype:'fieldset',
            title:'Import',
            items:[
            self.createUploadForm()
            ]
        }];
        
        
        self.callParent(arguments);
    },
    createUploadForm:function(){
        var self = this;
        return Ext.create('Ext.form.Panel', {
            border:false,
            frame: false,
            layout:'hbox',
            bodyStyle: 'background-color:#f0f2f4;',
            id:'uploadForm',
            items: [{
                xtype: 'filefield',
                name: 'importFile',
                style:'background-color:none;',
                width:240,
                allowBlank: false,
                buttonText: 'Datei wählen',
                blankText: 'Das Feld darf nicht leer sein!',
                msgTarget:'qtip',
                listeners: {
                    'change': function(button, value){
                        if(value.length>0){
                            Ext.getCmp("uploadButton").enable();
                        }else{
                            Ext.getCmp("uploadButton").disable();
                        }
                    },
                    'blur':function(fileField){
                        if(!fileField.isValid()){
                            Ext.getCmp("uploadButton").disable();
                        }else{
                            Ext.getCmp("uploadButton").enable();
                        }
                    }
                }
            }, {
                xtype:'button',
                cls: 'secondary small',
                id:'uploadButton',
                text: 'hochladen',
                margin:'4 0 0 5',
                disabled:true,
                handler:function(){
                    self.fireEvent('uploadFile');
                }
            }]
        });
    }
    
   
});
//{/block}

Das Event zum Testen liegt auf Button mit Beschriftung ‘Export (nur offen1)’. 

Es werden keinerlei Fehlermeldungen angezeigt noch irgendetwas anderes. 

Den gesamten Code habe ich zur Sicherheit nochmal in die Cloud unter https://adobe.ly/2CJbwKb hochgeladen.

Gruß

Yves

Moin @YvesHoenicke‍,
hier fallen mir spontan zwei Dinge auf.

  1. Deine Controller Action ist private. Die muss aber public sein. :slight_smile:
  2. Ich glaube du verwechselst hier etwas. Die Methode ‘fireEvent’ macht nur genau das, was der Name andeutet - ein Event abfeuern. Das ist  kein Request gegen deine Action.
    Du feuerst lediglich ein Event, auf dass irgendjemand horchen und reagieren muss.
    Das machst du normalerweise in einem Controller, so wie bspw. hier.

Im Prinzip rufst du in der ‘init’ Methode des Controllers die Methode ‘control’ auf.
Dort ist die Syntax wiefolgt:
 

me.control({
    'alias-deiner-view-komponente button[action=addColumn]' : {
          'event-name': this.exampleMethod
     }
});

...

exampleMethod: function(parameterDieDuÜbergebenHast) {
   ...
   // Mach einen Ajax Request gegen deine Action
}

Nun müsstest du dich in der ’ exampleMethod’ darum kümmern, einen AJAX-Request gegen deine Action zu feuern.
Wie du das in ExtJS machst, siehst du bspw. hier.

Zum Debuggen könntest du aber auch einfach mal in deine Button-Handler Funktion ein console.log(‘test’); einbauen, um zu sehen, dass ein Klick auf den Button durchaus etwas antriggert.

Hilft dir das erstmal weiter?

Gruß,
Patrick  Shopware

Hello friends, please tell me how can I add a menu item in the frontend using a plugin?

Hi [@Patrick Stahl](http://forum.shopware.com/profile/1869/Patrick Stahl “Patrick Stahl”)‍,

ich hab jetzt nochmal einiges geändert. Die Funktion hab ich in der control gesetzt und später auch beschrieben. Nun wird mir ein 503 Fehler angezeigt, dass er ein Template Snippet nicht laden kann. Das verwirrt mich allerdings total, da nirgends im Code nach einem Template verlangt wird.

Anbei dir Codes:

BigBellyWawi//Controllers/Backend/BigBellyWawi.php

View()->addTemplateDir( __DIR__. '/../../Resources/views');
    }
    
    public function doExportAllCsvAction() {
        $connection = $this->container->get('dbal_connection');
        
        $subshopData ='SELECT name FROM s_core_shops WHERE id=1';
        
        $subshopDataResult = $connection->query($subshopData)->fetch();
        
        echo $subshopDataResult['name'];
        //echo "console.log( 'Debug Objects: " . $subshopDataResult['name'] . "' );";
    }
    
}

 

BigBellyWawi//Resources/views/backend/big_belly_wawi/controller/main.js

/**
 *
*/
//{namespace name="backend/big_belly_wawi/view/main"}
//{block name="backend/big_belly_wawi/controller/main"}
Ext.define('Shopware.apps.BigBellyWawi.controller.Main', {
    
    extend: 'Enlight.app.Controller',
    refs: [{
        ref:'uploadForm',
        selector: '#uploadForm'
    }
    ],
    
    init:function () {
        var me = this;
        me.mainWindow = me.getView('main.Window').create({ }).show();
        
        me.control({
            'bigbelly-main-settings-form': {
                exportAction : me.onExport
                
            }
        });
    },
    
    /**
     * Iframe erzeugen und Controller aufrufen
     * @param link
     */
    onExport:function(link){
        try {
            Ext.destroy(Ext.get('downloadIframe'));
        }
        catch(e) {}
        
        //DOWNLOAD IFRAME starten
        var iframe = Ext.DomHelper.append(document.body, {
            tag: 'iframe',
            id:'downloadIframe',
            frameBorder: 0,
            width: 200,
            height: 100,
            src: link
        });  
    },
});
    //{/block}

BigBellyWawi//Resources/views/backend/big_belly_wawi/view/main/settings.js

//{namespace name="backend/big_belly_wawi_wawi/view/main"}
//{block name="backend/big_belly_wawi/view/main/settings"}
Ext.define('Shopware.apps.BigBellyWawi.view.main.Settings', {
 
    extend: 'Ext.form.Panel',
    
    title:'Exportieren von Bestellungen und Kunden',
    border: false,
    flex:1,
    region:'center',
    autoHeight:true,
    bodyPadding:5,
    fieldDefaults: {
        labelWidth: 95
    },
    defaultType: 'textfield',
    
    cls:Ext.baseCSSPrefix + 'bigbelly-main-settings-form',
    
    alias:'widget.bigbelly-main-settings-form',
    
    /**
     * Called when the component will be initialed.
     */
    initComponent: function() {
        var me = this;

        me.items = [{
            xtype:'fieldset',
            title:'Export',
            items:[{
                xtype: 'container',
                layout:'hbox',
                items:[{
                    xtype:'checkbox',
                    fieldLabel: 'E-Mail nicht versenden?',
                    id:'exportFirst',
                    width:'150',
                    labelStyle: 'width:150px;padding:0;'
                },{
                    xtype: 'button',
                    width:'150',
                    margin:'0 0 0 7',
                    text : 'Export (nur offen1)',
                    cls: 'secondary small',
                    iconCls: 'sprite-document-export',
                    handler:function(){
                        var link = '{url controller="BigBellyWawi" action="doExportAllCsv"}';
                        
                        me.fireEvent('exportAction',link);
                       
                    }
                }
                ]
            },{
                xtype: 'container',
                layout:'hbox',
                margin:'10 0 0 0',
                items:[{
                    xtype:'checkbox',
                    fieldLabel: 'E-Mail nicht versenden?',
                    width:'150',
                    labelStyle: 'width:150px;padding:0;',
                    id:'exportSecond'
                },{
                    xtype: 'button',
                    width:'150',
                    margin:'0 0 0 7',
                    text : 'Export (exkl. offen)',
                    cls: 'secondary small',
                    iconCls: 'sprite-document-export',
                    handler:function(){
                        var link = '{url controller="BigBellyWawi" action="doExportAllCsv"}';
                        //var secondLink = '{url controller="BigBellyWawi" action="doExportOrderCustomerCsv"}';
                        link+="?filter_=only_not_open&send_email_notification="+Ext.getCmp('exportSecond').getValue();
                       
                        me.fireEvent('exportAction',link,Ext.getCmp('exportSecond').getValue());
                        
                    }
                }
                ]
            },{
                xtype: 'container',
                layout:'hbox',
                margin:'10 0 0 0',
                items:[{
                    xtype:'checkbox',
                    fieldLabel: 'E-Mail nicht versenden?',
                    width:'150',
                    labelStyle: 'width:150px;padding:0;',
                    id:'exportThird'
                }, {
                    xtype: 'button',
                    width:'150',
                    margin:'0 0 0 7',
                    text : 'Export (alle)',
                    cls: 'secondary small',
                    iconCls: 'sprite-document-export',
                    handler:function(){
                        var link = '{url controller="BigBellyWawi" action="doExportAllCsv"}';
                        
                        link+="?send_email_notification="+Ext.getCmp('exportThird').getValue();
                        
                        me.fireEvent('exportAction',link,Ext.getCmp('exportSecond').getValue());
                       
                    }
                }
                ]
            }]
        },{
            xtype:'fieldset',
            title:'Import',
            items:[
            me.createUploadForm()
            ]
        }];
        
        
        me.callParent(arguments);
    },
    createUploadForm:function(){
        var me = this;
        return Ext.create('Ext.form.Panel', {
            border:false,
            frame: false,
            layout:'hbox',
            bodyStyle: 'background-color:#f0f2f4;',
            id:'uploadForm',
            items: [{
                xtype: 'filefield',
                name: 'importFile',
                style:'background-color:none;',
                width:240,
                allowBlank: false,
                buttonText: 'Datei wählen',
                blankText: 'Das Feld darf nicht leer sein!',
                msgTarget:'qtip',
                listeners: {
                    'change': function(button, value){
                        if(value.length>0){
                            Ext.getCmp("uploadButton").enable();
                        }else{
                            Ext.getCmp("uploadButton").disable();
                        }
                    },
                    'blur':function(fileField){
                        if(!fileField.isValid()){
                            Ext.getCmp("uploadButton").disable();
                        }else{
                            Ext.getCmp("uploadButton").enable();
                        }
                    }
                }
            }, {
                xtype:'button',
                cls: 'secondary small',
                id:'uploadButton',
                text: 'hochladen',
                margin:'4 0 0 5',
                disabled:true,
                handler:function(){
                    me.fireEvent('uploadFile');
                }
            }]
        });
    }
    
   
});
//{/block}

Selbst wenn ich die Abfrage in ein console.log setzen würde, verlangt er immer nach dieser tpl Datei. 

Gruß

Yves

Und hier die Fehlermeldung:

SmartyException: Unable to load template snippet 'backend/big_belly_wawi/do_export_all_csv.tpl' in /engine/Library/Smarty/sysplugins/smarty_internal_templatebase.php:127 Stack trace:
#0 /engine/Library/Enlight/View/Default.php(300): Smarty_Internal_TemplateBase->fetch()
#1 /engine/Library/Enlight/Controller/Plugins/ViewRenderer/Bootstrap.php(216): Enlight_View_Default->render(Object(Enlight_Template_Default))
#2 /engine/Library/Enlight/Controller/Plugins/ViewRenderer/Bootstrap.php(242): Enlight_Controller_Plugins_ViewRenderer_Bootstrap->renderTemplate(Object(Enlight_Template_Default))
#3 /engine/Library/Enlight/Controller/Plugins/ViewRenderer/Bootstrap.php(136): Enlight_Controller_Plugins_ViewRenderer_Bootstrap->render()
#4 /engine/Library/Enlight/Event/Handler/Default.php(91): Enlight_Controller_Plugins_ViewRenderer_Bootstrap->onPostDispatch(Object(Enlight_Controller_ActionEventArgs))
#5 /engine/Library/Enlight/Event/EventManager.php(220): Enlight_Event_Handler_Default->execute(Object(Enlight_Controller_ActionEventArgs))
#6 /engine/Library/Enlight/Controller/Action.php(235): Enlight_Event_EventManager->notify('Enlight_Control...', Object(Enlight_Controller_ActionEventArgs))
#7 /engine/Library/Enlight/Controller/Dispatcher/Default.php(549): Enlight_Controller_Action->dispatch('doExportAllCsvA...')
#8 /engine/Library/Enlight/Controller/Front.php(222): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp))
#9 /engine/Shopware/Kernel.php(202): Enlight_Controller_Front->dispatch()
#10 /vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php(102): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(448): Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(Object(Shopware\Kernel), Object(Symfony\Component\HttpFoundation\Request), 1, true)
#12 /engine/Shopware/Components/HttpCache/AppCache.php(268): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL)
#13 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(238): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true)
#14 /engine/Shopware/Components/HttpCache/AppCache.php(105): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true)
#15 /Applications/MAMP/htdocs/bigbally/shopware.php(122): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request))
#16 {main}

 

Moin @YvesHoenicke‍,

jede Controller Action erwartet im Standard ein geichnamiges Template - das wird in unseren Backend-Controllern nur deswegen nicht gemacht, weil das in der „preDispatch“-Methode ausgeschlossen wird.

Leider überschreibst du diese Methode mit denem Controller.
Füg’ deiner preDispatch-Methode mal den parent Call hinzu, also: parent::preDispatch();

Dann dürfte das schon einwandfrei funktionieren.

P.S.: Auskommentieren funktioniert nicht, weil die Backend JS Dateien durch den Smarty Parser laufen, bevor sie ausgeliefert werden.
Der Aufruf von _{url …} _ist ja Smarty Code - der wird also so oder so ausgeführt, weil es eben nicht erst im Javascript Code, sondern schon deutlich geparsed wird.
Ich hoffe, das war einigermaßen verständlich…

Gruß,
Patrick  Shopware