From 710851007b9f1c98331365c3c9580379b7d253c9 Mon Sep 17 00:00:00 2001 From: iglocska Date: Mon, 28 Sep 2020 13:14:45 +0200 Subject: [PATCH] fix: [internal] metafields can also be empty --- src/Controller/Component/CRUDComponent.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Controller/Component/CRUDComponent.php b/src/Controller/Component/CRUDComponent.php index 8a4ce5e..1cd172a 100644 --- a/src/Controller/Component/CRUDComponent.php +++ b/src/Controller/Component/CRUDComponent.php @@ -167,6 +167,9 @@ class CRUDComponent extends Component public function getMetaFields($id, $data) { + if (empty($this->Table->metaFields)) { + return $data; + } $query = $this->MetaFields->find(); $query->where(['scope' => $this->Table->metaFields, 'parent_id' => $id]); $metaFields = $query->all();