r91030 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91029‎ | r91030 | r91031 >
Date:23:06, 28 June 2011
Author:neilk
Status:ok
Tags:
Comment:
InstantCommons files also have -1 as page id; handle this case when dealing with filename uniqueness. (Did this change recently?!)
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.DestinationChecker.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.DestinationChecker.js
@@ -147,8 +147,12 @@
148148
149149 var result = undefined;
150150
151 - if ( data.query.pages[-1] ) {
152 - // No conflict found; this file name is unique
 151+ // The API will check for files with that filename.
 152+ // If no file found: a page with a key of -1 and no imageinfo
 153+ // If file found on another repository, such as when the wiki is using InstantCommons: page with a key of -1, plus imageinfo
 154+ // If file found on this repository: page with some positive numeric key
 155+ if ( data.query.pages[-1] && !data.query.pages[-1].imageinfo ) {
 156+ // No conflict found on any repository this wiki uses
153157 result = { isUnique: true };
154158
155159 } else {

Status & tagging log