fix: [crud:index] Only include requested metafields for non-API queries

develop-unstable
Sami Mokaddem 2023-02-13 15:38:12 +01:00
parent fce564f798
commit b9292473de
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 3 additions and 4 deletions

View File

@ -76,10 +76,9 @@ class CRUDComponent extends Component
if (!empty($options['order'])) {
$query->order($options['order']);
}
if ($this->Controller->ParamHandler->isRest()) {
if ($this->metaFieldsSupported()) {
$query = $this->includeRequestedMetaFields($query);
}
if ($this->metaFieldsSupported() && !$this->Controller->ParamHandler->isRest()) {
$query = $this->includeRequestedMetaFields($query);
}
if (!$this->Controller->ParamHandler->isRest()) {
$this->setRequestedEntryAmount();
}