fix: error when entity has no meta_fields
parent
5c520e440d
commit
c0a76d3f99
|
@ -704,7 +704,7 @@ class CRUDComponent extends Component
|
|||
if (empty($data)) {
|
||||
throw new NotFoundException(__('Invalid {0}.', $this->ObjectAlias));
|
||||
}
|
||||
if ($this->metaFieldsSupported()) {
|
||||
if ($this->metaFieldsSupported() && !empty($data['meta_fields'])) {
|
||||
$usedMetaTemplateIDs = array_values(array_unique(Hash::extract($data['meta_fields'], '{n}.meta_template_id')));
|
||||
$data = $this->attachMetaTemplatesIfNeeded($data, null, [
|
||||
'id IN' => $usedMetaTemplateIDs
|
||||
|
|
Loading…
Reference in New Issue