From 94bfafb743208333bc881f2e42fa0d827331be7f Mon Sep 17 00:00:00 2001 From: iglocska Date: Tue, 23 Aug 2022 16:02:52 +0200 Subject: [PATCH] fix: [meta template] fixes --- src/Controller/Component/CRUDComponent.php | 4 ---- src/Model/Entity/AppModel.php | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Controller/Component/CRUDComponent.php b/src/Controller/Component/CRUDComponent.php index 693b2ab..cbd1d26 100644 --- a/src/Controller/Component/CRUDComponent.php +++ b/src/Controller/Component/CRUDComponent.php @@ -413,7 +413,6 @@ class CRUDComponent extends Component $metaFieldsTable->patchEntity($entity->meta_fields[$index], [ 'value' => $new_value, 'meta_template_field_id' => $rawMetaTemplateField->id ], ['value']); - debug($entity); $metaFieldsTable->patchEntity( $entity->MetaTemplates[$template_id]->meta_template_fields[$meta_template_field_id]->metaFields[$meta_field_id], ['value' => $new_value, 'meta_template_field_id' => $rawMetaTemplateField->id], @@ -643,9 +642,6 @@ class CRUDComponent extends Component $metaTemplates[$metaTemplate->id]->meta_template_fields[$j]['metaFields'] = []; } } - if (!empty($metaTemplates[$metaTemplate->id]->meta_template_fields)) { - $metaTemplates[$metaTemplate->id]->meta_template_fields = array_values($metaTemplates[$metaTemplate->id]->meta_template_fields); - } } else { if (!empty($pruneEmptyDisabled) && !$metaTemplate->enabled) { unset($metaTemplates[$i]); diff --git a/src/Model/Entity/AppModel.php b/src/Model/Entity/AppModel.php index 1e54623..a94e78a 100644 --- a/src/Model/Entity/AppModel.php +++ b/src/Model/Entity/AppModel.php @@ -45,7 +45,7 @@ class AppModel extends Entity if ($field['counter'] > 0) { foreach ($field['metaFields'] as $metaField) { if (!empty($this->meta_fields[$template['name']][$field['field']])) { - if (!is_array($this->meta_fields[$template['name']])) { + if (!is_array($this->meta_fields[$template['name']][$field['field']])) { $this->meta_fields[$template['name']][$field['field']] = [$this->meta_fields[$template['name']][$field['field']]]; } $this->meta_fields[$template['name']][$field['field']][] = $metaField['value'];