fix: [meta template] fixes

cli-modification-summary
iglocska 2022-08-23 16:02:52 +02:00
parent 8bc3088e12
commit 94bfafb743
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
2 changed files with 1 additions and 5 deletions

View File

@ -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]);

View File

@ -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'];