Über eine Stunde habe ich über eine Fehlermeldung aus der REST API nach der Ursache gesucht:
Error message: An exception occurred while executing
'INSERT INTO s_article_configurator_options (group_id, name, position, media_id) VALUES (?, ?, ?, ?)' with params [8, "50 mm x 100 m", 0, null]:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'media_id' cannot be null
Diese Fehlermeldung muss neu sein, denn vor einiger Zeit kam diese nicht, wenn man bei einem Artikel auch die Optionen (configuratorSet) mit übergeben will. Laut Shopware Doku und Beispielen
=> REST API - Examples using the article resource
sieht das Array configuratorSet so aus:
Array
(
[groups] => Array
(
[0] => Array
(
[name] => Ausführung
[options] => Array
(
[50 mm x 100 m] => Array
(
[name] => 50 mm x 100 m
)
)
)
)
)
Geht natürlich nicht mehr, weil es jetzt so aussehen muss:
Array
(
[groups] => Array
(
[0] => Array
(
[name] => Ausführung
[options] => Array
(
[50 mm x 100 m] => Array
(
[name] => 50 mm x 100 m
[mediaId] => 0
)
)
)
)
)
Wäre schon wenn die Shopware Doku bzw. die Beispiele auch mal auf aktuellen Stand gebracht werden, ohne das User aus dem Forum darauf hinweisen müssen.