From aa351b3ccb37379f109fa3d9d96779a2c69a62b9 Mon Sep 17 00:00:00 2001 From: Sami Mokaddem Date: Mon, 28 Feb 2022 11:08:42 +0100 Subject: [PATCH] fix: [Component:CRUD] Prevent duplication of first metafield if it was unmodified --- src/Controller/Component/CRUDComponent.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/Component/CRUDComponent.php b/src/Controller/Component/CRUDComponent.php index 99fa39d..be839ac 100644 --- a/src/Controller/Component/CRUDComponent.php +++ b/src/Controller/Component/CRUDComponent.php @@ -400,7 +400,7 @@ class CRUDComponent extends Component } else { $new_value = $meta_field['value']; if (!empty($new_value)) { // update meta_field and attach validation errors - if (!empty($metaFieldsIndex[$meta_field_id])) { + if (isset($metaFieldsIndex[$meta_field_id])) { $index = $metaFieldsIndex[$meta_field_id]; $metaFieldsTable->patchEntity($entity->meta_fields[$index], [ 'value' => $new_value, 'meta_template_field_id' => $rawMetaTemplateField->id