summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/helpers/access.php2
-rw-r--r--modules/gallery/models/item.php3
2 files changed, 2 insertions, 3 deletions
diff --git a/modules/gallery/helpers/access.php b/modules/gallery/helpers/access.php
index c48f0b79..7b01058c 100644
--- a/modules/gallery/helpers/access.php
+++ b/modules/gallery/helpers/access.php
@@ -426,7 +426,7 @@ class access_Core {
$field = "{$perm_name}_{$group->id}";
$cache_table = $perm_name == "view" ? "items" : "access_caches";
$db->query("ALTER TABLE {{$cache_table}} ADD `$field` SMALLINT NOT NULL DEFAULT 0");
- $db->query("ALTER TABLE {access_intents} ADD `$field` BOOLEAN DEFAULT NULL");
+ $db->query("ALTER TABLE {access_intents} ADD `$field` SMALLINT DEFAULT NULL");
$db->update("access_intents", array($field => 0), array("item_id" => 1));
ORM::factory("access_intent")->clear_cache();
}
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index 430119b5..7dbbbcb1 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -389,8 +389,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