jenkins-bot has submitted this change and it was merged.
Change subject: Correct mixups of default vs predefined namespaces when
creating titles
......................................................................
Correct mixups of default vs predefined namespaces when creating titles
In both places, we already know that the title is in the 'File' namespace,
and we can't let the title to end up with a different namespace.
Depends on Ib78dbcb0910bf1458b842b4d9ece6d204761b202 in MediaWiki core.
Change-Id: Ib5afee871081fb3871ba271411ad8a546a57c63b
---
M resources/mw.UploadWizardDetails.js
M resources/mw.UploadWizardUpload.js
2 files changed, 2 insertions(+), 2 deletions(-)
Approvals:
MarkTraceur: Looks good to me, approved
jenkins-bot: Verified
diff --git a/resources/mw.UploadWizardDetails.js
b/resources/mw.UploadWizardDetails.js
index c004971..4c21a85 100644
--- a/resources/mw.UploadWizardDetails.js
+++ b/resources/mw.UploadWizardDetails.js
@@ -981,7 +981,7 @@
} else if ( warnings[ 'bad-prefix' ] ) {
this.recoverFromError( mw.message(
'mwe-upwiz-error-title-senselessimagename' ), 'title-senselessimagename' );
} else if ( existingFile ) {
- existingFileUrl = mw.config.get(
'wgServer' ) + new mw.Title( existingFile, NS_FILE ).getUrl();
+ existingFileUrl = mw.config.get(
'wgServer' ) + mw.Title.makeTitle( NS_FILE, existingFile ).getUrl();
this.recoverFromError( mw.message(
'mwe-upwiz-api-warning-exists', existingFileUrl ).parse(), 'api-warning-exists'
);
} else if ( warnings.duplicate ) {
this.recoverFromError( mw.message(
'mwe-upwiz-upload-error-duplicate' ), 'upload-error-duplicate' );
diff --git a/resources/mw.UploadWizardUpload.js
b/resources/mw.UploadWizardUpload.js
index 0527778..2f71d62 100644
--- a/resources/mw.UploadWizardUpload.js
+++ b/resources/mw.UploadWizardUpload.js
@@ -289,7 +289,7 @@
$a.addClass( 'new' );
params = { action: 'edit', redlink: '1'
};
}
- href = new mw.Title( filename, NS_FILE
).getUrl( params );
+ href = mw.Title.makeTitle( NS_FILE, filename
).getUrl( params );
$a.attr( { href: href, target: '_blank' } );
} catch ( e ) {
// For example, if the file was revdeleted
--
To view, visit https://gerrit.wikimedia.org/r/260617
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib5afee871081fb3871ba271411ad8a546a57c63b
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: Bartosz DziewoĆski <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits