mdg_giftreg icon indicating copy to clipboard operation
mdg_giftreg copied to clipboard

Chapter 5: can't save registry

Open lycenok opened this issue 7 years ago • 0 comments

'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);

lycenok avatar Nov 17 '17 03:11 lycenok