# Layout-Zuweisung schläft fehl (SQL-Fehler "Cannot add or update a child row")

**URL:** https://forum.shopware.com/t/layout-zuweisung-schlaeft-fehl-sql-fehler-cannot-add-or-update-a-child-row/89743
**Category:** Shopware 6 (German)
**Created:** [13. August 2021 um 10:49 UTC](https://forum.shopware.com/t/layout-zuweisung-schlaeft-fehl-sql-fehler-cannot-add-or-update-a-child-row/89743 "2021-08-13T10:49:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![andreherdling](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/andreherdling/32/8074_2.png) [@andreherdling](https://forum.shopware.com/u/andreherdling)
#### Post date: [13. August 2021 um 10:49 UTC](https://forum.shopware.com/t/layout-zuweisung-schlaeft-fehl-sql-fehler-cannot-add-or-update-a-child-row/89743/1 "2021-08-13T10:49:17Z")

</div>

Hallo Community,

beim Ändern einer bestehenden Layout-Zuweisung für eine Produkt-Kategorie (in meinem Fall das Startseitenlayout) erhalte ich die Fehlermeldung „_Bitte füllen Sie alle Pfichtfelder aus._“ In den Developer-Tools des Browser sehe ich als Antwort des Servers (der mit Status-Code 500 antwortet) Folgendes:

```auto
An exception occurred while executing 'UPDATE `category` 
SET `parent_version_id` = ?, `after_category_version_id` = ?, `cms_page_id` = ?, `updated_at` = ? 
WHERE version_id = ? AND id = ?' with params ["\x0f\xa9\x1c\xe3\xe9\x6a\x4b\xc2\xbe\x4b\xd9\xce\x75\x2c\x34\x25", "\x0f\xa9\x1c\xe3\xe9\x6a\x4b\xc2\xbe\x4b\xd9\xce\x75\x2c\x34\x25", "\x5b\x5f\xd6\x72\x57\x21\x4b\x84\x9d\x02\x4c\x09\x72\xdf\x19\x3e", "2021-08-13 10:33:18.795", "\x0f\xa9\x1c\xe3\xe9\x6a\x4b\xc2\xbe\x4b\xd9\xce\x75\x2c\x34\x25", "\x40\xab\x00\xec\xf9\xd3\x4f\x24\xa1\x62\xca\xb5\x52\x02\x7e\xa7"]:
SQLSTATE[23000]: Integrity constraint violation: 
1452 Cannot add or update a child row: 
a foreign key constraint fails (`shopware_db`.`category`, CONSTRAINT `fk.category.cms_page_id` FOREIGN KEY (`cms_page_id`, `cms_page_version_id`) REFERENCES `cms_page` (`id`, `version_id`) ON UPDATE CASCADE)

```

Wenn ich die Layout-Zuweisung im Erlebniswelten-Designer vornehmen möchte, erhalte ich als Fehlermeldung „_Request failed with status code 500_“ – in den Developer-Tools sehe ich die selbige Antwort die auf ein Problem beim Speichern in der Datenbank hinweist. Auf keinen der möglichen Wege ist es mir also möglich, das Startseiten-Layout zu ändern.

Kenn jemand das Problem und weiß eine Lösung hierfür?

(Aktuell nutzen wir noch Shopware 6.3.5.4 da nach dem Update-Versuch auf die neueste Version garnichts mehr lief und wir ein Backup wiederherstellen mussten.)

Besten Dank für Hinweise aller Art vorab!  
André
