# Plugin: beim Erstellen einer Entity kommt "Expected data to be array"

**URL:** <https://forum.shopware.com/t/plugin-beim-erstellen-einer-entity-kommt-expected-data-to-be-array/71341>\
**Category:** Programmierung\
**Created:** [3. Dezember 2020 um 09:58 UTC](https://forum.shopware.com/t/plugin-beim-erstellen-einer-entity-kommt-expected-data-to-be-array/71341 "2020-12-03T09:58:20Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Michael86](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@Michael86](https://forum.shopware.com/u/Michael86)\
**Post date:** [17. Dezember 2020 um 10:52 UTC](https://forum.shopware.com/t/plugin-beim-erstellen-einer-entity-kommt-expected-data-to-be-array/71341/8 "2020-12-17T10:52:28Z")

</div>

Noch eine Anmerkung:

Was mir auch gerade aufgefallen ist (ich hatte noch was geändert):

```
(new ManyToOneAssociationField('productManufacturer', 'product_manufacturer_id', ProductManufacturerDefinition::class))->addFlags(new Required()),

```

Er mag es anscheinend nicht, wenn man dem ManyToOneAssociationField das Flag “new Required()” mitgibt. Möglicherweise war das die eigentliche Ursache, da das Backend dann womöglich ein Feld ‘productManufacturer’ im POST-Request&nbsp;erwartet, während das eigentlich nötige Feld ja&nbsp; ‘productManufacturerId’ ist.

---

_[View the full topic](https://forum.shopware.com/t/plugin-beim-erstellen-einer-entity-kommt-expected-data-to-be-array/71341)._
