chg: [component:CRUD] Include meta-template before calling `afterFind`
parent
0833a8c0e4
commit
fda8aa5866
|
@ -568,16 +568,16 @@ class CRUDComponent extends Component
|
||||||
$query->where($params['conditions']);
|
$query->where($params['conditions']);
|
||||||
}
|
}
|
||||||
$data = $query->first();
|
$data = $query->first();
|
||||||
|
if ($this->metaFieldsSupported()) {
|
||||||
|
$metaTemplates = $this->getMetaTemplates();
|
||||||
|
$data = $this->attachMetaTemplatesIfNeeded($data, $metaTemplates->toArray());
|
||||||
|
}
|
||||||
if (isset($params['afterFind'])) {
|
if (isset($params['afterFind'])) {
|
||||||
$data = $params['afterFind']($data, $params);
|
$data = $params['afterFind']($data, $params);
|
||||||
}
|
}
|
||||||
if (empty($data)) {
|
if (empty($data)) {
|
||||||
throw new NotFoundException(__('Invalid {0}.', $this->ObjectAlias));
|
throw new NotFoundException(__('Invalid {0}.', $this->ObjectAlias));
|
||||||
}
|
}
|
||||||
if ($this->metaFieldsSupported()) {
|
|
||||||
$metaTemplates = $this->getMetaTemplates();
|
|
||||||
$data = $this->attachMetaTemplatesIfNeeded($data, $metaTemplates->toArray());
|
|
||||||
}
|
|
||||||
if ($this->request->is(['post', 'put'])) {
|
if ($this->request->is(['post', 'put'])) {
|
||||||
$patchEntityParams = [
|
$patchEntityParams = [
|
||||||
'associated' => []
|
'associated' => []
|
||||||
|
|
Loading…
Reference in New Issue