summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/gallery/models/item.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index 129bd77f..58ac8f18 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -401,8 +401,7 @@ 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)
- ORDER BY `{$this->sort_column}` {$this->sort_order}")->current()->position;
+ FROM {items} WHERE id = $child_id)")->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