Ibexa DXP Discussions

Community discussion forum for developers working with Ibexa DXP

Priority not working

Hello. We are running versjon 3.2 and dok not gt Priority sort clause to work. This is the code we are currntly using, cansomeone please help?

<?php

namespace App\QueryType;

use eZ\Publish\API\Repository\Values\Content\Query\SortClause;
use eZ\Publish\API\Repository\Values\Content\Query\Criterion;
use eZ\Publish\API\Repository\Values\Content\Query\Criterion\Location\IsMainLocation;
use eZ\Publish\API\Repository\Values\Content\LocationQuery;
use eZ\Publish\Core\QueryType\QueryType;

class ArticleQueryType implements QueryType
{
public static function getName()
{
return ‘Article’;
}

public function getQuery(array $parameters = [])
{
    return new LocationQuery([
        'filter' => new Criterion\LogicalAnd(
            [
                new Criterion\Visibility(Criterion\Visibility::VISIBLE),
                new Criterion\Location\IsMainLocation(IsMainLocation::MAIN),
                new Criterion\ContentTypeIdentifier(['enersen_artikkel_vanlig']),
            ]
        ),
        'sortClauses' =>
            [
		        new SortClause\Location\Priority(LocationQuery::SORT_ASC),
		    ]

    ]);
}

public function getSupportedParameters()
{
}

}

Regards, Atle

Strange, I’m running the same code like you but I don’t get your issue. Did you solve it in the meanwhile?

Nope, no solution :frowning:

Atle