From a2e40f12f59ecbbbd82895c34aa46bc726d7a619 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sun, 17 Jun 2012 22:31:08 +0200 Subject: [PATCH] (bug 31777) Upload unknown error ``fileexists-forbidden'' adding messages to ApiBase::$messageMap and to message files for client side localisation Change-Id: I37e03130c6b90e4614514cd76b73eab6890eb82f --- RELEASE-NOTES-1.20 | 1 + includes/api/ApiBase.php | 2 ++ includes/api/ApiUpload.php | 2 ++ languages/messages/MessagesEn.php | 2 ++ languages/messages/MessagesQqq.php | 2 ++ maintenance/language/messages.inc | 2 ++ 6 files changed, 11 insertions(+) diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index 7f6abff5df..021e4e8a7a 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -153,6 +153,7 @@ upgrade PHP if you have not done so prior to upgrading MediaWiki. * (bug 32643) action=purge with forcelinkupdate no longer crashes when ratelimit is reached * The paraminfo module now also contains result properties for most modules * (bug 32348) Allow descending order for list=alllinks +* (bug 31777) Upload unknown error ``fileexists-forbidden'' === Languages updated in 1.20 === diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 883a3c085d..a6e33639e9 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -1307,6 +1307,8 @@ abstract class ApiBase extends ContextSource { 'specialpage-cantexecute' => array( 'code' => 'specialpage-cantexecute', 'info' => "You don't have permission to view the results of this special page" ), 'invalidoldimage' => array( 'code' => 'invalidoldimage', 'info' => 'The oldimage parameter has invalid format' ), 'nodeleteablefile' => array( 'code' => 'nodeleteablefile', 'info' => 'No such old version of the file' ), + 'fileexists-forbidden' => array( 'code' => 'fileexists-forbidden', 'info' => 'A file with name "$1" already exists, and cannot be overwritten.' ), + 'fileexists-shared-forbidden' => array( 'code' => 'fileexists-shared-forbidden', 'info' => 'A file with name "$1" already exists in the shared file repository, and cannot be overwritten.' ), // ApiEditPage messages 'noimageredirect-anon' => array( 'code' => 'noimageredirect-anon', 'info' => "Anonymous users can't create image redirects" ), diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index db1ee1643f..aaa4c85dd8 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -687,6 +687,8 @@ class ApiUpload extends ApiBase { array( 'code' => 'stashfailed', 'info' => 'Stashing temporary file failed' ), array( 'code' => 'internal-error', 'info' => 'An internal error occurred' ), array( 'code' => 'asynccopyuploaddisabled', 'info' => 'Asynchronous copy uploads disabled' ), + array( 'fileexists-forbidden' ), + array( 'fileexists-shared-forbidden' ), ) ); } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 4f4fe7285d..c7d1ed010d 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -4844,6 +4844,8 @@ Otherwise, you can use the easy form below. Your comment will be added to the pa 'api-error-emptypage' => 'Creating new, empty pages is not allowed.', 'api-error-fetchfileerror' => 'Internal error: Something went wrong while fetching the file.', 'api-error-file-too-large' => 'The file you submitted was too large.', +'api-error-fileexists-forbidden' => 'A file with name "$1" already exists, and cannot be overwritten.', +'api-error-fileexists-shared-forbidden' => 'A file with name "$1" already exists in the shared file repository, and cannot be overwritten.', 'api-error-filename-tooshort' => 'The filename is too short.', 'api-error-filetype-banned' => 'This type of file is banned.', 'api-error-filetype-missing' => 'The filename is missing an extension.', diff --git a/languages/messages/MessagesQqq.php b/languages/messages/MessagesQqq.php index dbf6c8471e..3300d1feed 100644 --- a/languages/messages/MessagesQqq.php +++ b/languages/messages/MessagesQqq.php @@ -4721,6 +4721,8 @@ $4 is the gender of the target user.', 'api-error-emptypage' => 'API error message that can be used for client side localisation of API errors.', 'api-error-fetchfileerror' => 'API error message that can be used for client side localisation of API errors.', 'api-error-file-too-large' => 'API error message that can be used for client side localisation of API errors.', +'api-error-fileexists-forbidden' => 'API error message that can be used for client side localisation of API errors.', +'api-error-fileexists-shared-forbidden' => 'API error message that can be used for client side localisation of API errors.', 'api-error-filename-tooshort' => 'API error message that can be used for client side localisation of API errors.', 'api-error-filetype-banned' => 'API error message that can be used for client side localisation of API errors.', 'api-error-filetype-missing' => 'The word "extension" refers to the part behind the last dot in a file name, that by convention gives a hint about the kind of data format which a files contents are in.', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 76984f2a91..2e381aa011 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -3702,6 +3702,8 @@ $wgMessageStructure = array( 'api-error-empty-file', 'api-error-emptypage', 'api-error-fetchfileerror', + 'api-error-fileexists-forbidden', + 'api-error-fileexists-shared-forbidden', 'api-error-file-too-large', 'api-error-filename-tooshort', 'api-error-filetype-banned', -- 2.20.1