RepositoryQuery: Disim.. Fix sort order handling

refs #8826
This commit is contained in:
Johannes Meyer 2015-05-21 13:52:43 +02:00
parent 9278d708d7
commit ba31be9695
1 changed files with 3 additions and 1 deletions

View File

@ -266,7 +266,9 @@ class RepositoryQuery implements QueryInterface, Iterator
try {
$this->query->order(
$this->repository->requireFilterColumn($this->target, $column),
$direction ? $baseDirection : ($specificDirection ?: $baseDirection)
$specificDirection ?: $baseDirection
// I would have liked the following solution, but hey, a coder should be allowed to produce crap...
// $specificDirection && (! $direction || $column !== $field) ? $specificDirection : $baseDirection
);
} catch (QueryException $_) {
Logger::info('Cannot order by column "%s" in repository "%s"', $column, $this->repository->getName());