From 80e9fcaf47af6a041db385f18b0be00c15708da7 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 1 Sep 2010 22:00:26 -0700 Subject: [PATCH 1/2] Don't use $.remove() to get rid of items from the uploadify queue; that breaks uploadify and causes it to be unable to upload any new items. Fixes ticket #1324. --- modules/gallery/views/form_uploadify.html.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/gallery/views/form_uploadify.html.php b/modules/gallery/views/form_uploadify.html.php index 36f5f284c8..893bb3b9d0 100644 --- a/modules/gallery/views/form_uploadify.html.php +++ b/modules/gallery/views/form_uploadify.html.php @@ -60,7 +60,7 @@ function(data) { $("#g-add-photos-status ul").append( "
  • " + fileObj.name + " - " + for_js() ?> + "
  • "); - setTimeout(function() { $("#q" + queueID).slideUp("slow") }, 5000); + setTimeout(function() { $("#q" + queueID).slideUp("slow").remove() }, 5000); success_count++; update_status(); return true; @@ -87,8 +87,8 @@ function(data) { .replace("__TYPE__", errorObj.type)); } $("#g-add-photos-status ul").append( - "
  • " + fileObj.name + msg + "
  • "); - $("#g-uploadify" + queueID).remove(); + "
  • " + fileObj.name + msg + "
  • "); + $("#g-uploadify").uploadifyCancel(queueID); error_count++; update_status(); }, From 70c8572ea1b421458241b9b3b1cc85cb6bf35057 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 1 Sep 2010 22:19:44 -0700 Subject: [PATCH 2/2] Make RENAME TABLE operations idempotent so that in case there's a failure of some kind we can restart the upgrade and it'll continue. Fixes ticket #1325. --- modules/gallery/helpers/gallery_installer.php | 4 +++- modules/rest/helpers/rest_installer.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index d5264fcc2e..fa5113bfe8 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -550,7 +550,9 @@ static function upgrade($version) { } if ($version == 26) { - $db->query("RENAME TABLE {failed_logins} TO {failed_auths}"); + if (in_array("failed_logins", Database::instance()->list_tables())) { + $db->query("RENAME TABLE {failed_logins} TO {failed_auths}"); + } module::set_version("gallery", $version = 27); } diff --git a/modules/rest/helpers/rest_installer.php b/modules/rest/helpers/rest_installer.php index c2694a29c6..3c7fea4b5b 100644 --- a/modules/rest/helpers/rest_installer.php +++ b/modules/rest/helpers/rest_installer.php @@ -35,7 +35,9 @@ static function install() { static function upgrade($version) { $db = Database::instance(); if ($version == 1) { - $db->query("RENAME TABLE {user_access_tokens} TO {user_access_keys}"); + if (in_array("user_access_tokens", Database::instance()->list_tables())) { + $db->query("RENAME TABLE {user_access_tokens} TO {user_access_keys}"); + } module::set_version("rest", $version = 2); }