From 5048c38ed653f60aa18129b3ac68fcd8fd7c5e6d Mon Sep 17 00:00:00 2001 From: iglocska Date: Wed, 28 Aug 2024 16:13:09 +0200 Subject: [PATCH] fix: [CRUD] run afterfind even if no metatemplates set --- src/Controller/Component/CRUDComponent.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Controller/Component/CRUDComponent.php b/src/Controller/Component/CRUDComponent.php index 441a5e7..f2683a2 100644 --- a/src/Controller/Component/CRUDComponent.php +++ b/src/Controller/Component/CRUDComponent.php @@ -432,9 +432,9 @@ class CRUDComponent extends Component if ($metaFieldsEnabled) { $metaTemplates = $this->getMetaTemplates(); $data = $this->attachMetaTemplatesIfNeeded($data, $metaTemplates->toArray()); - if (isset($params['afterFind'])) { - $data = $params['afterFind']($data, $params); - } + } + if (isset($params['afterFind'])) { + $data = $params['afterFind']($data, $params); } if ($this->request->is('post')) { $patchEntityParams = [