# Plugin Configuration lässst sich nicht speichern

**URL:** <https://forum.shopware.com/t/plugin-configuration-lassst-sich-nicht-speichern/47845>\
**Category:** Programmierung\
**Created:** [25. August 2017 um 21:33 UTC](https://forum.shopware.com/t/plugin-configuration-lassst-sich-nicht-speichern/47845 "2017-08-25T21:33:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [25. August 2017 um 21:33 UTC](https://forum.shopware.com/t/plugin-configuration-lassst-sich-nicht-speichern/47845/1 "2017-08-25T21:33:59Z")

</div>

Hi, ich habe ein Plugin geschrieben, Nur leider lassen sich die Einstellungen nicht speichern. Ich bekomme in der Console “Cannot read property ‘add’ of null”

&nbsp;

```
public function createConfiguration(){
        $form = $this->Form();
        $form->setElement("checkbox","active",
            array("label"=>"xxx",
                "value"=>true,
                "description" => "xxx.",
                "scope" => Shopware\Models\Config\Element::SCOPE_SHOP
            )
        );
        $form->setElement("color","color",
            array("label"=>"Color",
                'value'=>'#eeeeee',
                "description" => "xxx.",
                "scope" => Shopware\Models\Config\Element::SCOPE_SHOP
            )
        );
        $form->save();
    }

```

Hat hierzu jemand eine Idee? SW 5.3.2, PHP 7.1.8

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [29. August 2017 um 06:25 UTC](https://forum.shopware.com/t/plugin-configuration-lassst-sich-nicht-speichern/47845/2 "2017-08-29T06:25:31Z")

</div>

Hust, jemand eine Idee? Das Plugin ist so wie fast alle anderen Plugins die ich geschrieben habe. Liegt das an 5.3.2 ? Geht die alte Pluginstruktur noch?&nbsp;

---

<div class="post-metadata">

**Author:** ![sonic](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sonic/32/25728_2.png) [@sonic](https://forum.shopware.com/u/sonic)\
**Post date:** [29. August 2017 um 06:29 UTC](https://forum.shopware.com/t/plugin-configuration-lassst-sich-nicht-speichern/47845/3 "2017-08-29T06:29:33Z")

</div>

Ich hab kein $form-\>save() am Ende

```
$form = $this->Form();
$form->setElement(...);
$form->setElement(...);

```

und es funktioniert bis 5.3.1

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [29. August 2017 um 06:34 UTC](https://forum.shopware.com/t/plugin-configuration-lassst-sich-nicht-speichern/47845/4 "2017-08-29T06:34:31Z")

</div>

Gilt die Pluginstruktur&nbsp;allgemein bis 5.3.1 oder meinst du bei deinen Plugins? @sonic‍

---

<div class="post-metadata">

**Author:** ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)\
**Post date:** [29. August 2017 um 06:38 UTC](https://forum.shopware.com/t/plugin-configuration-lassst-sich-nicht-speichern/47845/5 "2017-08-29T06:38:43Z")

</div>

Die alte Plugin-Struktur wurde bisher nichtmal deprecated, entsprechend steht noch garnicht fest ob und wann diese entfernt wird 😉

---

<div class="post-metadata">

**Author:** ![sonic](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/sonic/32/25728_2.png) [@sonic](https://forum.shopware.com/u/sonic)\
**Post date:** [29. August 2017 um 06:39 UTC](https://forum.shopware.com/t/plugin-configuration-lassst-sich-nicht-speichern/47845/6 "2017-08-29T06:39:36Z")

</div>

Ich bau mir gerade noch eins um, und das ist die alte Struktur. Testen tu ich dieses derzeit noch auf einen 5.3.1  
Ich habe habe auch alle meine kleinen Helfer (u.a. Piwik) etc. unter 5.3.2 laufen.

> **[Legacy & 5.2 plugin structure](https://forum.shopware.com/discussion/comment/191597/#Comment_191597)**
>
> As @brettvormkopp‍ already said: plugins developed in the old (pre v5.2) way still work in Shopware v5.2 and will continue to do so for the foreseeable future. So, if you need to support Shopware versions below 5.2, develop your plugin the old way...
