fix: [Component:CRUD] Prevent duplication of first metafield if it was unmodified

pull/93/head
Sami Mokaddem 2022-02-28 11:08:42 +01:00
parent c13fb53ae0
commit aa351b3ccb
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 1 additions and 1 deletions

View File

@ -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