fix: [component:CRUD] Make sure to append model alias when ordering results

perm_community_admin
Sami Mokaddem 2024-04-02 14:15:47 +02:00
parent 96d53f4b6a
commit 305274f636
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 2 additions and 0 deletions

View File

@ -97,6 +97,8 @@ class CRUDComponent extends Component
if ($sort[0] != $this->Table->getAlias()) {
$sort[0] = Inflector::camelize(Inflector::pluralize($sort[0]));
}
} else {
array_unshift($sort, $this->Table->getAlias());
}
$sort = implode('.', $sort);
$query->order($sort . ' ' . $direction);