fix: [component:CRUD] Make sure not to override table aliases when paginating
parent
42a5bd03c6
commit
2274fff424
|
@ -90,8 +90,10 @@ class CRUDComponent extends Component
|
|||
if ($this->_validOrderFields($sort) && ($direction === 'asc' || $direction === 'desc')) {
|
||||
$sort = explode('.', $sort);
|
||||
if (count($sort) > 1) {
|
||||
if ($sort[0] != $this->Table->getAlias()) {
|
||||
$sort[0] = Inflector::camelize(Inflector::pluralize($sort[0]));
|
||||
}
|
||||
}
|
||||
$sort = implode('.', $sort);
|
||||
$query->order($sort . ' ' . $direction);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue