Hallo!
Ich habe gerade mit erschrecken festgestellt, dass per Plugin Remotecombos der Abruf von Attributen nicht klappt.
Mein Aufruf sah bisher immer so aus:
$form->setElement(
'combo',
'FooKey',
array(
'label' => 'Foo Label',
'value' => "",
'valueField' => 'id',
'displayField' => 'name',
'triggerAction' => 'all',
'store' => 'new Ext.data.Store({
fields: [
"id",
"name"
],
proxy : {
type : "ajax",
autoLoad : true,
api : {
read: document.location.pathname + \'Config/getList?_repositoryClass=attribute\',
},
reader : {
type : "json",
root : "data"
}
}
})',
'required' => false,
'scope' => Shopware\Models\Config\Element::SCOPE_SHOP
)
);
Die read Angabe wurde mal von Shopware hier im Forum empfohlen, weil der url controller in gewissen Umständen die URL cached.
Die Comboboxen bleiben leer, wenn ich die Backend URL selbst Aufrufe erhalte ich:
"Ups! Ein Fehler ist aufgetreten!
Die nachfolgenden Hinweise sollten Ihnen weiterhelfen.
The provided CSRF-Token is invalid. If you’re sure that the request should be valid, the called controller action needs to be whitelisted using the CSRFWhitelistAware interface. in engine/Shopware/Components/CSRFTokenValidator.php on line 108"
Was ist also zu tun? Ich benötige unbedingt Hilfe!
Nachtrag
Leider ging an mir die CSRFT Implementierung vorbei.
Habe mich an den Guide unter https://developers.shopware.com/developers-guide/csrf-protection/ gehalten (1:1), komme aber weiterhin nicht zum Erfolg.
Die Remotecombo bleibt leer. Da es ja unendliche viele Plugins gibt, die das gleiche machen werden (Kundengruppen/Freifelder abfragen) muss es da ja eine Lösung für geben …
Schöne Grüße,
Niklas
Schöne Grüße,
Niklas