diff options
-rw-r--r-- | core/models/item.php | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/core/models/item.php b/core/models/item.php index f2fb8fa4..9f9134fa 100644 --- a/core/models/item.php +++ b/core/models/item.php @@ -299,11 +299,10 @@ class Item_Model extends ORM_MPTT { * the first child in the album is at position 1. */ public function get_position($child_id) { - // Right now we only sort by id ascending, so bake that assumption in here. - // @todo fix this when we introduce sort orders. return ORM::factory("item") ->where("parent_id", $this->id) ->where("id <=", $child_id) + ->orderby(array($this->sort_column => $this->sort_order)) ->count_all(); } |