From 440597356d8719bdc6733d2d86aaef5f86d05a1e Mon Sep 17 00:00:00 2001 From: Joe7 Date: Mon, 27 Dec 2010 22:16:29 +0100 Subject: Added changes to installer and upgrader scripts to support INSERT ON DUPLICATE KEY UPDATE SYNTAX in cache lib --- installer/install.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'installer/install.sql') diff --git a/installer/install.sql b/installer/install.sql index 427a3283..baee2b9d 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -43,7 +43,7 @@ CREATE TABLE {caches} ( `expiration` int(9) NOT NULL, `cache` longblob, PRIMARY KEY (`id`), - KEY `key` (`key`), + UNIQUE KEY `key` (`key`), KEY `tags` (`tags`) ) DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- cgit v1.2.3 From affbc28876901058810d9fd26a8f7795084f2efd Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 31 Dec 2010 22:29:00 -0800 Subject: Update gallery module to v42 to reflect key changes in the cache table in 440597356d8719bdc6733d2d86aaef5f86d05a1e for #1559. --- installer/install.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'installer/install.sql') diff --git a/installer/install.sql b/installer/install.sql index baee2b9d..2a2bf269 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -43,7 +43,7 @@ CREATE TABLE {caches} ( `expiration` int(9) NOT NULL, `cache` longblob, PRIMARY KEY (`id`), - UNIQUE KEY `key` (`key`), + KEY `key` (`key`), KEY `tags` (`tags`) ) DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -244,7 +244,7 @@ CREATE TABLE {modules} ( KEY `weight` (`weight`) ) AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO {modules} VALUES (1,1,'gallery',41,1); +INSERT INTO {modules} VALUES (1,1,'gallery',42,1); INSERT INTO {modules} VALUES (2,1,'user',3,2); INSERT INTO {modules} VALUES (3,1,'comment',3,3); INSERT INTO {modules} VALUES (4,1,'organize',2,4); -- cgit v1.2.3 From b26eff7f23b970a7983baf5e211ba88968effb9d Mon Sep 17 00:00:00 2001 From: Joe7 Date: Mon, 3 Jan 2011 15:44:36 +0100 Subject: Bugfix: input validation validates description up to length of 65535 chars, but DB trimmed data over 2048 chars. Converting column into TEXT type. Note: The effective maximum length of a VARCHAR in MySQL 5.0.3 and later is subject to the maximum row size (65,535 bytes, which is shared among all columns) and the character set used. In contrast to CHAR, VARCHAR values are stored as a one-byte or two-byte length prefix plus data. The length prefix indicates the number of bytes in the value. A column uses one length byte if values require no more than 255 bytes, two length bytes if values may require more than 255 bytes. --- installer/install.sql | 2 +- modules/gallery/helpers/gallery_installer.php | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'installer/install.sql') diff --git a/installer/install.sql b/installer/install.sql index 2a2bf269..7a0f99c4 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -152,7 +152,7 @@ CREATE TABLE {items} ( `album_cover_item_id` int(9) DEFAULT NULL, `captured` int(9) DEFAULT NULL, `created` int(9) DEFAULT NULL, - `description` varchar(2048) DEFAULT NULL, + `description` TEXT DEFAULT NULL, `height` int(9) DEFAULT NULL, `left_ptr` int(9) NOT NULL, `level` int(9) NOT NULL, diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index cb314527..90d6d4b7 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -309,7 +309,7 @@ class gallery_installer { module::set_var("gallery", "show_user_profiles_to", "registered_users"); module::set_var("gallery", "extra_binary_paths", "/usr/local/bin:/opt/local/bin:/opt/bin"); - module::set_version("gallery", 42); + module::set_version("gallery", 43); } static function upgrade($version) { @@ -648,6 +648,11 @@ class gallery_installer { $db->query("ALTER TABLE {caches} DROP INDEX `key`, ADD UNIQUE `key` (`key`)"); module::set_version("gallery", $version = 42); } + + if ($version == 42) { + $db->query("ALTER TABLE {items} CHANGE `description` `description` TEXT DEFAULT NULL"); + module::set_version("gallery", $version = 43); + } } static function uninstall() { -- cgit v1.2.3 From 70ac063c5590572d1a074632e9e06558951eaf52 Mon Sep 17 00:00:00 2001 From: Joe7 Date: Mon, 3 Jan 2011 19:49:13 +0100 Subject: case fix --- installer/install.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'installer/install.sql') diff --git a/installer/install.sql b/installer/install.sql index 7a0f99c4..c398d130 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -152,7 +152,7 @@ CREATE TABLE {items} ( `album_cover_item_id` int(9) DEFAULT NULL, `captured` int(9) DEFAULT NULL, `created` int(9) DEFAULT NULL, - `description` TEXT DEFAULT NULL, + `description` text DEFAULT NULL, `height` int(9) DEFAULT NULL, `left_ptr` int(9) NOT NULL, `level` int(9) NOT NULL, -- cgit v1.2.3 From 8263cb023fb4fe0b6fdc9fc61b35518dcf09946e Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 3 Jan 2011 11:14:58 -0800 Subject: Updated installer for the bump of the gallery module to v43. Fixes #1568. --- installer/install.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'installer/install.sql') diff --git a/installer/install.sql b/installer/install.sql index c398d130..84a975ae 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -152,7 +152,7 @@ CREATE TABLE {items} ( `album_cover_item_id` int(9) DEFAULT NULL, `captured` int(9) DEFAULT NULL, `created` int(9) DEFAULT NULL, - `description` text DEFAULT NULL, + `description` varchar(2048) DEFAULT NULL, `height` int(9) DEFAULT NULL, `left_ptr` int(9) NOT NULL, `level` int(9) NOT NULL, @@ -244,7 +244,7 @@ CREATE TABLE {modules} ( KEY `weight` (`weight`) ) AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO {modules} VALUES (1,1,'gallery',42,1); +INSERT INTO {modules} VALUES (1,1,'gallery',43,1); INSERT INTO {modules} VALUES (2,1,'user',3,2); INSERT INTO {modules} VALUES (3,1,'comment',3,3); INSERT INTO {modules} VALUES (4,1,'organize',2,4); -- cgit v1.2.3 From d74aad072d8ccca70efb1c8b673e8368566a1974 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 3 Jan 2011 12:25:51 -0800 Subject: Some small follow on fixes for #1559 and #1568: 1) Make database changes in gallery_installer::install() instead of in installer/install.ql 2) Bump the version number in modules/gallery/module.info --- installer/install.sql | 4 ++-- modules/gallery/helpers/gallery_installer.php | 4 ++-- modules/gallery/module.info | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'installer/install.sql') diff --git a/installer/install.sql b/installer/install.sql index 84a975ae..6aae8014 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -43,7 +43,7 @@ CREATE TABLE {caches} ( `expiration` int(9) NOT NULL, `cache` longblob, PRIMARY KEY (`id`), - KEY `key` (`key`), + UNIQUE KEY `key` (`key`), KEY `tags` (`tags`) ) DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -152,7 +152,7 @@ CREATE TABLE {items} ( `album_cover_item_id` int(9) DEFAULT NULL, `captured` int(9) DEFAULT NULL, `created` int(9) DEFAULT NULL, - `description` varchar(2048) DEFAULT NULL, + `description` text, `height` int(9) DEFAULT NULL, `left_ptr` int(9) NOT NULL, `level` int(9) NOT NULL, diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 834a27fa..f7b8da5f 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -44,7 +44,7 @@ class gallery_installer { `expiration` int(9) NOT NULL, `cache` longblob, PRIMARY KEY (`id`), - KEY (`key`), + UNIQUE KEY (`key`), KEY (`tags`)) DEFAULT CHARSET=utf8;"); @@ -84,7 +84,7 @@ class gallery_installer { `album_cover_item_id` int(9) default NULL, `captured` int(9) default NULL, `created` int(9) default NULL, - `description` varchar(2048) default NULL, + `description` text default NULL, `height` int(9) default NULL, `left_ptr` int(9) NOT NULL, `level` int(9) NOT NULL, diff --git a/modules/gallery/module.info b/modules/gallery/module.info index 0cc3f6d1..eb579ab6 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,3 @@ name = "Gallery 3" description = "Gallery core application" -version = 42 +version = 43 -- cgit v1.2.3 From d17ba036ee2a4cadb5d1fa03397bbf975d6c254b Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 7 Jan 2011 20:40:24 -0800 Subject: Don't enable the REST module by default (fixes #1585). Bump the info module per changes for #662. --- installer/install.sql | 33 ++++++++++++-------------------- modules/gallery/controllers/packager.php | 2 +- 2 files changed, 13 insertions(+), 22 deletions(-) (limited to 'installer/install.sql') diff --git a/installer/install.sql b/installer/install.sql index 6aae8014..c1d71dc2 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -242,18 +242,17 @@ CREATE TABLE {modules} ( PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`), KEY `weight` (`weight`) -) AUTO_INCREMENT=11 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO {modules} VALUES (1,1,'gallery',43,1); INSERT INTO {modules} VALUES (2,1,'user',3,2); INSERT INTO {modules} VALUES (3,1,'comment',3,3); INSERT INTO {modules} VALUES (4,1,'organize',2,4); -INSERT INTO {modules} VALUES (5,1,'info',1,5); -INSERT INTO {modules} VALUES (6,1,'rest',3,6); -INSERT INTO {modules} VALUES (7,1,'rss',1,7); -INSERT INTO {modules} VALUES (8,1,'search',1,8); -INSERT INTO {modules} VALUES (9,1,'slideshow',2,9); -INSERT INTO {modules} VALUES (10,1,'tag',2,10); +INSERT INTO {modules} VALUES (5,1,'info',2,5); +INSERT INTO {modules} VALUES (6,1,'rss',1,6); +INSERT INTO {modules} VALUES (7,1,'search',1,7); +INSERT INTO {modules} VALUES (8,1,'slideshow',2,8); +INSERT INTO {modules} VALUES (9,1,'tag',2,9); DROP TABLE IF EXISTS {outgoing_translations}; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -350,18 +349,6 @@ CREATE TABLE {themes} ( /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO {themes} VALUES (1,'wind',1); INSERT INTO {themes} VALUES (2,'admin_wind',1); -DROP TABLE IF EXISTS {user_access_keys}; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE {user_access_keys} ( - `id` int(9) NOT NULL AUTO_INCREMENT, - `user_id` int(9) NOT NULL, - `access_key` char(32) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY `access_key` (`access_key`), - UNIQUE KEY `user_id` (`user_id`) -) DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS {users}; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -395,7 +382,7 @@ CREATE TABLE {vars} ( `value` text, PRIMARY KEY (`id`), UNIQUE KEY `module_name` (`module_name`,`name`) -) AUTO_INCREMENT=35 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=39 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO {vars} VALUES (NULL,'gallery','active_site_theme','wind'); INSERT INTO {vars} VALUES (NULL,'gallery','active_admin_theme','admin_wind'); @@ -429,5 +416,9 @@ INSERT INTO {vars} VALUES (NULL,'gallery','identity_provider','user'); INSERT INTO {vars} VALUES (NULL,'user','mininum_password_length','5'); INSERT INTO {vars} VALUES (NULL,'comment','spam_caught','0'); INSERT INTO {vars} VALUES (NULL,'comment','access_permissions','everybody'); -INSERT INTO {vars} VALUES (NULL,'rest','allow_guest_access','0'); +INSERT INTO {vars} VALUES (NULL,'info','show_title','1'); +INSERT INTO {vars} VALUES (NULL,'info','show_description','1'); +INSERT INTO {vars} VALUES (NULL,'info','show_owner','1'); +INSERT INTO {vars} VALUES (NULL,'info','show_name','1'); +INSERT INTO {vars} VALUES (NULL,'info','show_captured','1'); INSERT INTO {vars} VALUES (NULL,'slideshow','max_scale','0'); diff --git a/modules/gallery/controllers/packager.php b/modules/gallery/controllers/packager.php index bd51b93c..9da34f9c 100644 --- a/modules/gallery/controllers/packager.php +++ b/modules/gallery/controllers/packager.php @@ -59,7 +59,7 @@ class Packager_Controller extends Controller { // numbers, keeping our install.sql file more stable. srand(0); - foreach (array("gallery", "user", "comment", "organize", "info", "rest", + foreach (array("gallery", "user", "comment", "organize", "info", "rss", "search", "slideshow", "tag") as $module_name) { module::install($module_name); module::activate($module_name); -- cgit v1.2.3 From 4fc5d50eb83f29c0a28ce16b9ff22179fd3f2c98 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 8 Jan 2011 12:59:12 -0800 Subject: Bump the organize module to version 3 and get rid of the code that makes sure that it depends on the REST module. --- installer/install.sql | 2 +- modules/organize/helpers/organize_event.php | 18 --------- modules/organize/helpers/organize_installer.php | 49 ------------------------- modules/organize/module.info | 4 +- 4 files changed, 3 insertions(+), 70 deletions(-) delete mode 100644 modules/organize/helpers/organize_installer.php (limited to 'installer/install.sql') diff --git a/installer/install.sql b/installer/install.sql index c1d71dc2..09fabc7d 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -247,7 +247,7 @@ CREATE TABLE {modules} ( INSERT INTO {modules} VALUES (1,1,'gallery',43,1); INSERT INTO {modules} VALUES (2,1,'user',3,2); INSERT INTO {modules} VALUES (3,1,'comment',3,3); -INSERT INTO {modules} VALUES (4,1,'organize',2,4); +INSERT INTO {modules} VALUES (4,1,'organize',1,4); INSERT INTO {modules} VALUES (5,1,'info',2,5); INSERT INTO {modules} VALUES (6,1,'rss',1,6); INSERT INTO {modules} VALUES (7,1,'search',1,7); diff --git a/modules/organize/helpers/organize_event.php b/modules/organize/helpers/organize_event.php index d6d21fc1..58daf180 100644 --- a/modules/organize/helpers/organize_event.php +++ b/modules/organize/helpers/organize_event.php @@ -51,22 +51,4 @@ class organize_event_Core { } } } - - static function pre_deactivate($data) { - if ($data->module == "rest") { - $data->messages["warn"][] = t("The Organize module requires the Rest module."); - } - } - - static function module_change($changes) { - if (!module::is_active("rest") || in_array("rest", $changes->deactivate)) { - site_status::warning( - t("The Organize module requires the Rest module. Activate the Rest module now", - array("url" => html::mark_clean(url::site("admin/modules")))), - "organize_needs_rest"); - } else { - site_status::clear("organize_needs_rest"); - } - } - } diff --git a/modules/organize/helpers/organize_installer.php b/modules/organize/helpers/organize_installer.php deleted file mode 100644 index 2faa598b..00000000 --- a/modules/organize/helpers/organize_installer.php +++ /dev/null @@ -1,49 +0,0 @@ -Activate the Rest module now", - array("url" => html::mark_clean(url::site("admin/modules")))), - "organize_needs_rest"); - } - - module::set_version("organize", $version = 2); - } - } - - static function can_activate() { - $messages = array(); - if (!module::is_active("rest")) { - $messages["warn"][] = t("The Organize module requires the Rest module."); - } - return $messages; - } -} diff --git a/modules/organize/module.info b/modules/organize/module.info index d7199571..be0bc86d 100644 --- a/modules/organize/module.info +++ b/modules/organize/module.info @@ -1,3 +1,3 @@ name = "Organize" -description = "Organize your gallery by apply tags or moving images" -version = 2 +description = "Visually rearrange and move photos in your gallery" +version = 3 -- cgit v1.2.3 From e1e1e860cd1b19ebef491f0c0f82a3cd18e63721 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 8 Jan 2011 16:51:25 -0800 Subject: Use the code version when installing a module that has no installer, instead of hardcoding version 1. Fixes #1589. --- installer/install.sql | 2 +- modules/gallery/helpers/module.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'installer/install.sql') diff --git a/installer/install.sql b/installer/install.sql index 09fabc7d..0ed7f2f3 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -247,7 +247,7 @@ CREATE TABLE {modules} ( INSERT INTO {modules} VALUES (1,1,'gallery',43,1); INSERT INTO {modules} VALUES (2,1,'user',3,2); INSERT INTO {modules} VALUES (3,1,'comment',3,3); -INSERT INTO {modules} VALUES (4,1,'organize',1,4); +INSERT INTO {modules} VALUES (4,1,'organize',3,4); INSERT INTO {modules} VALUES (5,1,'info',2,5); INSERT INTO {modules} VALUES (6,1,'rss',1,6); INSERT INTO {modules} VALUES (7,1,'search',1,7); diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php index 7c5578af..6efe6162 100644 --- a/modules/gallery/helpers/module.php +++ b/modules/gallery/helpers/module.php @@ -168,7 +168,7 @@ class module_Core { if (method_exists($installer_class, "install")) { call_user_func_array(array($installer_class, "install"), array()); } else { - module::set_version($module_name, 1); + module::set_version($module_name, module::available()->$module_name->code_version); } // Set the weight of the new module, which controls the order in which the modules are -- cgit v1.2.3