diff options
author | Bharat Mediratta <bharat@menalto.com> | 2011-01-11 16:59:57 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2011-01-11 16:59:57 -0800 |
commit | ee53744aa73b06f262122b6236014618fe6d742c (patch) | |
tree | 90d6386593f43376ce2e0833514ab572048257e4 /modules/gallery/controllers/admin_languages.php | |
parent | f80b5959f1bd3a015d55e10709040a35d6850090 (diff) |
Two improvements to Joe's fix for #1504:
1) Trap all exceptions, eg dns or connectivity issues and
report back in the form (but put the stack trace in the logs)
2) Rename "noconn" to "no_connection"
Diffstat (limited to 'modules/gallery/controllers/admin_languages.php')
-rw-r--r-- | modules/gallery/controllers/admin_languages.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/gallery/controllers/admin_languages.php b/modules/gallery/controllers/admin_languages.php index e9be2a88..f96a0eb7 100644 --- a/modules/gallery/controllers/admin_languages.php +++ b/modules/gallery/controllers/admin_languages.php @@ -77,7 +77,7 @@ class Admin_Languages_Controller extends Admin_Controller { if ($new_key) { list($connected, $valid) = l10n_client::validate_api_key($new_key); if (!$valid) { - $form->sharing->api_key->add_error($connected ? "invalid" : "noconn", 1); + $form->sharing->api_key->add_error($connected ? "invalid" : "no_connection", 1); } } else { $valid = true; @@ -122,7 +122,8 @@ class Admin_Languages_Controller extends Admin_Controller { : t("API key")) ->value($api_key) ->error_messages("invalid", t("The API key you provided is invalid.")) - ->error_messages("noconn", t("Could not connect to remote server to validate the API key.")); + ->error_messages( + "no_connection", t("Could not connect to remote server to validate the API key.")); $group->submit("save")->value(t("Save settings")); if ($api_key && $this->_outgoing_translations_count()) { // TODO: UI improvement: hide API key / save button when API key is set. |