mdg_giftreg
mdg_giftreg copied to clipboard
Chapter 5: can't save registry
'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails ... FK_MDG_GIFTREGISTRY_ENTITY_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID on saving in Backend
Worked arround by this in GiftregistryController.php:
// need to save customer as it is not passed by Post-request // Lycenok $customerId = $registry->getCustomerId(); $registry->setData($data); // Lycenok: restore customer_id $registry->setCustomerId($customerId);