From 70c8572ea1b421458241b9b3b1cc85cb6bf35057 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 1 Sep 2010 22:19:44 -0700 Subject: 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/rest/helpers/rest_installer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'modules/rest') diff --git a/modules/rest/helpers/rest_installer.php b/modules/rest/helpers/rest_installer.php index c2694a29..3c7fea4b 100644 --- a/modules/rest/helpers/rest_installer.php +++ b/modules/rest/helpers/rest_installer.php @@ -35,7 +35,9 @@ class rest_installer { 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); } -- cgit v1.2.3 From 9f11d8ad832ef8691398ef12036d40596c8de053 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 11 Sep 2010 22:38:47 -0700 Subject: Log the JSON response on errors so that we can figure out what's going wrong. This will help diagnose #1364 which appears to be an ORM_Validation_Exception, except the actual output is getting eaten by the Organize SWF so we can't see it without snooping network traffic. --- modules/rest/views/error_rest.json.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/rest') diff --git a/modules/rest/views/error_rest.json.php b/modules/rest/views/error_rest.json.php index 179ce7f9..8c99ef45 100644 --- a/modules/rest/views/error_rest.json.php +++ b/modules/rest/views/error_rest.json.php @@ -1,2 +1,6 @@ +response, 1)); +?> response); \ No newline at end of file -- cgit v1.2.3