fix: [component:CRUD] Make sure to append model alias when ordering results
parent
96d53f4b6a
commit
305274f636
|
@ -97,6 +97,8 @@ class CRUDComponent extends Component
|
||||||
if ($sort[0] != $this->Table->getAlias()) {
|
if ($sort[0] != $this->Table->getAlias()) {
|
||||||
$sort[0] = Inflector::camelize(Inflector::pluralize($sort[0]));
|
$sort[0] = Inflector::camelize(Inflector::pluralize($sort[0]));
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
array_unshift($sort, $this->Table->getAlias());
|
||||||
}
|
}
|
||||||
$sort = implode('.', $sort);
|
$sort = implode('.', $sort);
|
||||||
$query->order($sort . ' ' . $direction);
|
$query->order($sort . ' ' . $direction);
|
||||||
|
|
Loading…
Reference in New Issue