Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
ConfigEntityQuery::addOrderBy is a little bit strange. If you define sorting for a view, the $field var is set. If you switch the sorting over table-sorting, then only the $alias var is set. So addOrderBy should work in both cases
Comment | File | Size | Author |
---|---|---|---|
#4 | sorting_issue-2877275-4.patch | 609 bytes | chr.fritsch |
#2 | sorting_issue-2877275-2.patch | 609 bytes | chr.fritsch |
Comments
Comment #2
chr.fritschHere is a patch to fix it
Comment #3
vijaycs85by the look of Drupal\views\Plugin\views\query\Sql::addOrderBy, $alias gets priority over field. Can we change the condition to check $alias first?
Comment #4
chr.fritschYes, of course
Comment #5
vijaycs85Looks good.
Comment #7
vijaycs85Thanks @chr.fritsch