Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-6540: Added Depth sort to breadcrumbs #2115

Merged
merged 2 commits into from
Mar 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/lib/QueryType/LocationPathQueryType.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php

Check warning on line 1 in src/lib/QueryType/LocationPathQueryType.php

View workflow job for this annotation

GitHub Actions / Run code style check (8.0)

Found violation(s) of type: trailing_comma_in_multiline

/**
* @copyright Copyright (C) Ibexa AS. All rights reserved.
Expand All @@ -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 @@
? 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()]
ViniTou marked this conversation as resolved.
Show resolved Hide resolved
]);
}

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