Skip to content

Commit

Permalink
Ignore limit if no order exists when building subquery
Browse files Browse the repository at this point in the history
  • Loading branch information
othercorey committed Oct 5, 2021
1 parent 5b4b77b commit 5492061
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ORM/Association/Loader/SelectLoader.php
Expand Up @@ -404,7 +404,7 @@ protected function _buildSubquery(Query $query): Query
$filterQuery->contain([], true);
$filterQuery->setValueBinder(new ValueBinder());

if (!$filterQuery->clause('limit')) {
if (!$filterQuery->clause('limit') || !$filterQuery->clause('order')) {
$filterQuery->limit(null);
$filterQuery->order([], true);
$filterQuery->offset(null);
Expand Down

0 comments on commit 5492061

Please sign in to comment.