Commit 7a9664db authored by bojanz's avatar bojanz

Don't throw notices in postDelete() if the deleted entity is malformed (required field empty).

parent 6614f6c4
......@@ -107,6 +107,9 @@ class Order extends ContentEntityBase implements OrderInterface {
// Delete the line items of a deleted order.
$lineItems = [];
foreach ($entities as $entity) {
if (empty($entity->line_items)) {
continue;
}
foreach ($entity->line_items as $item) {
$lineItems[$item->target_id] = $item->entity;
}
......
......@@ -186,6 +186,9 @@ class Product extends ContentEntityBase implements ProductInterface {
// Delete the product variations of a deleted product.
$variations = [];
foreach ($entities as $entity) {
if (empty($entity->variations)) {
continue;
}
foreach ($entity->variations as $item) {
$variations[$item->target_id] = $item->entity;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment