Use PUT instead of POST when updating project-specific resources at Transifex

(DBOINCP-141)
This commit is contained in:
Tristan Olive 2015-05-07 01:20:17 -04:00
parent c5b2e89feb
commit 56b5696f43
1 changed files with 3 additions and 1 deletions

View File

@ -396,6 +396,7 @@ function boinctranslate_export_translations() {
'category' => 'Drupal',
'content' => boinctranslate_get_po('en', 'project'),
);
$result = boinctranslate_transifex_request($path, $post);
}
else {
// Update the source
@ -403,8 +404,8 @@ function boinctranslate_export_translations() {
$post = array(
'content' => boinctranslate_get_po('en', 'project')
);
$result = boinctranslate_transifex_request($path, $post, TRUE, TRUE);
}
$result = boinctranslate_transifex_request($path, $post);
}
if (substr($result, 0, 6) != 'ERROR:') {
@ -606,6 +607,7 @@ function boinctranslate_transifex_request($path, $post = NULL, $json = TRUE, $us
return "ERROR: {$response_body}";
}
elseif (strstr($response_header, '405 METHOD NOT ALLOWED')) {
watchdog('boinctranslate', "The following response was received when trying to communicate with the Transifex system: \n{$result}", array(), WATCHDOG_WARNING);
return "ERROR: User not allowed to perform this action";
}
elseif (strstr($response_header, '200 OK')) {