Skip to content

Commit

Permalink
IBX-6540: Added Depth sort to breadcrumbs
Browse files Browse the repository at this point in the history
Signed-off-by: Dawid Parafiński <[email protected]>
  • Loading branch information
ViniTou committed Mar 1, 2024
1 parent b0db6f5 commit 9f2a61d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/QueryType/LocationPathQueryType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use eZ\Publish\API\Repository\Values\Content\Location;
use eZ\Publish\API\Repository\Values\Content\LocationQuery;
use eZ\Publish\API\Repository\Values\Content\Query;
use eZ\Publish\API\Repository\Values\Content\Query\SortClause\Location\Depth;
use eZ\Publish\Core\QueryType\OptionsResolverBasedQueryType;
use Symfony\Component\OptionsResolver\OptionsResolver;

Expand Down Expand Up @@ -42,7 +43,10 @@ protected function doGetQuery(array $parameters): Query
? new Query\Criterion\ParentLocationId($rootLocationId)
: new Query\Criterion\LocationId($this->getParentLocationPath($location));

return new LocationQuery(['filter' => $filter]);
return new LocationQuery([
'filter' => $filter,
'sortClauses' => [new Depth()]
]);
}

private function getParentLocationPath(Location $location): array
Expand Down

0 comments on commit 9f2a61d

Please sign in to comment.