Bartosz Dziewoński has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/251195

Change subject: mw.UploadWizardDetails: Upload TitleBlacklist error handling 
for T115258
......................................................................

mw.UploadWizardDetails: Upload TitleBlacklist error handling for T115258

'code' is always 'titleblacklist-forbidden' now, the specific error
message is returned in 'message'.

Change-Id: If25432c9972d8327fb9f1e985bfeed839d844db2
---
M resources/mw.UploadWizardDetails.js
1 file changed, 9 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard 
refs/changes/95/251195/1

diff --git a/resources/mw.UploadWizardDetails.js 
b/resources/mw.UploadWizardDetails.js
index a43d4e7..7e8e5f2 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -1784,13 +1784,15 @@
                processError: function ( code, result ) {
                        var statusKey, comma,
                                statusLine = mw.message( 
'api-error-unclassified' ).text(),
-                               titleErrorMap = {
-                                       senselessimagename: 
'senselessimagename',
-                                       'fileexists-shared-forbidden': 
'fileexists-shared-forbidden',
+                               titleBlacklistMessageMap = {
+                                       senselessimagename: 
'senselessimagename', // TODO This is probably never hit?
                                        'titleblacklist-custom-filename': 
'hosting',
                                        'titleblacklist-custom-SVG-thumbnail': 
'thumbnail',
                                        'titleblacklist-custom-thumbnail': 
'thumbnail',
-                                       
'titleblacklist-custom-double-apostrophe': 'double-apostrophe',
+                                       
'titleblacklist-custom-double-apostrophe': 'double-apostrophe'
+                               },
+                               titleErrorMap = {
+                                       'fileexists-shared-forbidden': 
'fileexists-shared-forbidden',
                                        protectedpage: 'protected'
                                };
 
@@ -1806,6 +1808,9 @@
                                if ( titleErrorMap[ code ] ) {
                                        this.recoverFromError( this.titleId, 
mw.message( 'mwe-upwiz-error-title-' + titleErrorMap[ code ] ).escaped(), 
'title-' + titleErrorMap[ code ] );
                                        return;
+                               } else if ( code === 'titleblacklist-forbidden' 
) {
+                                       this.recoverFromError( this.titleId, 
mw.message( 'mwe-upwiz-error-title-' + titleBlacklistMessageMap[ 
result.error.message ] ).escaped(), 'title-' + titleBlacklistMessageMap[ 
result.error.message ] );
+                                       return;
                                } else {
                                        statusKey = 'api-error-' + code;
                                        if ( code === 'filetype-banned' && 
result.error.blacklisted ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/251195
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If25432c9972d8327fb9f1e985bfeed839d844db2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to