Skip to content

Commit

Permalink
Revert "Remove unnecessary ORDER_BY clause"
Browse files Browse the repository at this point in the history
This reverts commit 2a42ea3.

Turns out the ORDER BY was necessary after all...

Fixes #26781
  • Loading branch information
dregad committed Mar 16, 2020
1 parent ce30898 commit 82f2273
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/project_hierarchy_api.php
Expand Up @@ -157,11 +157,12 @@ function project_hierarchy_cache( $p_show_disabled = false ) {
db_param_push();
$t_enabled_clause = $p_show_disabled ? '1=1' : 'p.enabled = ' . db_param();

$t_query = 'SELECT DISTINCT p.id, ph.parent_id, p.inherit_global, ph.inherit_parent
$t_query = 'SELECT DISTINCT p.id, ph.parent_id, p.name, p.inherit_global, ph.inherit_parent
FROM {project} p
LEFT JOIN {project_hierarchy} ph
ON ph.child_id = p.id
WHERE ' . $t_enabled_clause;
WHERE ' . $t_enabled_clause . '
ORDER BY p.name';

$t_result = db_query( $t_query, ( $p_show_disabled ? array() : array( true ) ) );

Expand Down

0 comments on commit 82f2273

Please sign in to comment.