summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRomain LE DISEZ <romain.git@ledisez.net>2009-06-23 10:09:46 +0200
committerRomain LE DISEZ <romain.git@ledisez.net>2009-06-23 10:09:46 +0200
commitc80d2da0a95a63b76f5a4c835f1a0e1022ec2f53 (patch)
treeece7b5b2c4bd859f38a40feef91ef82322a8785a
parent2e6a1d6fdc562b2ff797deaf8b8ab019c17ed113 (diff)
Remove an useless ORDER BY.
It improves compatibility with PgSQL.
-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 7dce9e51..44d79d5b 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -382,8 +382,7 @@ class Item_Model extends ORM_MPTT {
SELECT COUNT(*) AS position FROM {items}
WHERE parent_id = {$this->id}
AND {$this->sort_column} <= (SELECT {$this->sort_column}
- FROM {items} WHERE id = $child_id)
- ORDER BY {$this->sort_column} {$this->sort_order}");
+ FROM {items} WHERE id = $child_id)");
return $result->current()->position;
}