Skip to content

Commit

Permalink
Revert "Remove an useless ORDER BY."... the order by wasn't all that …
Browse files Browse the repository at this point in the history
…useless.

This reverts commit c80d2da.

Conflicts:

	modules/gallery/models/item.php
  • Loading branch information
andyst committed Jul 27, 2009
1 parent 482e223 commit d18f31a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/gallery/models/item.php
Expand Up @@ -387,7 +387,8 @@ public function get_position($child_id) {
SELECT COUNT(*) AS position FROM {items}
WHERE parent_id = {$this->id}
AND `{$this->sort_column}` $comp (SELECT `{$this->sort_column}`
FROM {items} WHERE id = $child_id)")->current()->position;
FROM {items} WHERE id = $child_id)
ORDER BY `{$this->sort_column}` {$this->sort_order}")->current()->position;

// We stopped short of our target value in the sort (notice that we're using a < comparator
// above) because it's possible that we have duplicate values in the sort column. An
Expand Down

0 comments on commit d18f31a

Please sign in to comment.