From 316c42fb522b40fd8dcec93a2548a372531bdcd2 Mon Sep 17 00:00:00 2001 From: Tristan Olive Date: Fri, 17 Apr 2015 13:05:19 -0400 Subject: [PATCH] Added handling for 200 OK responses in Transifex requests (DBOINCP-141) --- .../modules/boinctranslate/boinctranslate.module | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drupal/sites/default/boinc/modules/boinctranslate/boinctranslate.module b/drupal/sites/default/boinc/modules/boinctranslate/boinctranslate.module index efbbb62e32..950791e9c3 100644 --- a/drupal/sites/default/boinc/modules/boinctranslate/boinctranslate.module +++ b/drupal/sites/default/boinc/modules/boinctranslate/boinctranslate.module @@ -420,6 +420,15 @@ function boinctranslate_update_official_boinc_translations() { ); break; } + elseif ($result == 'success') { + drupal_set_message("Updated {$language_name} official BOINC translations"); + } + else { + drupal_set_message( + "Unexpected response for {$language_name}: {$result}", + 'warning' + ); + } } else { drupal_set_message("Updated {$language_name} official BOINC translations"); @@ -489,6 +498,9 @@ function boinctranslate_transifex_request($path, $post = NULL, $json = TRUE, $us elseif (strstr($response_header, '405 METHOD NOT ALLOWED')) { return "ERROR: User not allowed to perform this action"; } + elseif (strstr($response_header, '200 OK')) { + return 'success'; + } } elseif ($json) { // Process as JSON