Details
-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
5.4-dev
-
None
Description
According to phpdoc for https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/API/Repository/Values/Content/Query/SortClause/Field.php#L30, you can pass null as the language param when using and SortClause\Field.
In other words, theorically you could do something like
$query->sortClauses = array( new Query\SortClause\Field( 'content_type_identifier', 'field_identifier') );
but doing like that throws an exception
Argument '$query->sortClauses[0]' is invalid: No language is specified for translatable field
This is because searchService throws a exception when null is passed
https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/Repository/SearchService.php#L222
To me, null should be allowed and then take main language as default for doing the sort. Otherwise, phpdoc of that method needs to be update.