From d18f31ab218c8d79d97b19079ac0078e6155bc39 Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Mon, 27 Jul 2009 11:25:23 -0700 Subject: Revert "Remove an useless ORDER BY."... the order by wasn't all that useless. This reverts commit c80d2da0a95a63b76f5a4c835f1a0e1022ec2f53. Conflicts: modules/gallery/models/item.php --- modules/gallery/models/item.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 45561380..c1d11a96 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -387,7 +387,8 @@ class Item_Model extends ORM_MPTT { 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 -- cgit v1.2.3