diff options
| author | Chad Kieffer <ckieffer@gmail.com> | 2009-06-06 00:35:39 -0600 |
|---|---|---|
| committer | Chad Kieffer <ckieffer@gmail.com> | 2009-06-06 00:35:39 -0600 |
| commit | 7cdcb5179f6d5414c9224fb65b7b36ab69ba52da (patch) | |
| tree | ffc78236234505ca953870dc68ffb76fe0cae872 /modules/gallery/models | |
| parent | c5425f42a4a13f7f585ffe45c070a865cdef6077 (diff) | |
| parent | 329bd8caa126040ba7abaf28e8f76e0b6739ceff (diff) | |
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/models')
| -rw-r--r-- | modules/gallery/models/item.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 10bad0b2..7dce9e51 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -380,7 +380,7 @@ class Item_Model extends ORM_MPTT { public function get_position($child_id) { $result = Database::instance()->query(" SELECT COUNT(*) AS position FROM {items} - WHERE parent_id = {$this->parent_id} + 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}"); |
