diff options
-rwxr-xr-x | installer/install.sql | 2 | ||||
-rw-r--r-- | modules/gallery/helpers/access.php | 2 | ||||
-rw-r--r-- | modules/gallery/models/item.php | 3 |
3 files changed, 3 insertions, 4 deletions
diff --git a/installer/install.sql b/installer/install.sql index 91108460..d02d8d69 100755 --- a/installer/install.sql +++ b/installer/install.sql @@ -55,7 +55,7 @@ CREATE TABLE {comments} ( `server_remote_addr` varchar(32) default NULL, `server_remote_host` varchar(64) default NULL, `server_remote_port` varchar(16) default NULL, - `state` char(15) default 'unpublished', + `state` varchar(15) default 'unpublished', `text` text, `updated` int(9) NOT NULL, PRIMARY KEY (`id`) 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 |