Skip to content

Commit

Permalink
fix: [component:CRUD] Make sure to append model alias when ordering r…
Browse files Browse the repository at this point in the history
…esults
  • Loading branch information
mokaddem committed Apr 2, 2024
1 parent 96d53f4 commit 305274f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Controller/Component/CRUDComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ public function index(array $options): void
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);
Expand Down

0 comments on commit 305274f

Please sign in to comment.