r87096 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87095‎ | r87096 | r87097 >
Date:19:17, 28 April 2011
Author:kaldari
Status:ok
Tags:
Comment:
follow-up to 87002, take into account Flickr adding new licenses, i.e. unknown license ID
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.FlickrChecker.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.FlickrChecker.js
@@ -41,13 +41,15 @@
4242 if ( typeof data.photo != 'undefined' ) {
4343 // The returned data.photo.license is just an ID that we use to look up the license name
4444 var licenseName = mw.FlickrChecker.licenseList[data.photo.license];
45 - // Use the license name to retrieve the template values
46 - var licenseValue = mw.FlickrChecker.licenseMaps[licenseName];
47 - // Set the license message to show the user.
48 - if ( licenseValue == 'invalid' ) {
49 - var licenseMessage = gM( 'mwe-upwiz-license-external-invalid', 'Flickr', licenseName );
50 - } else {
51 - var licenseMessage = gM( 'mwe-upwiz-license-external', 'Flickr', licenseName );
 45+ if ( typeof licenseName != 'undefined' ) {
 46+ // Use the license name to retrieve the template values
 47+ var licenseValue = mw.FlickrChecker.licenseMaps[licenseName];
 48+ // Set the license message to show the user.
 49+ if ( licenseValue == 'invalid' ) {
 50+ var licenseMessage = gM( 'mwe-upwiz-license-external-invalid', 'Flickr', licenseName );
 51+ } else {
 52+ var licenseMessage = gM( 'mwe-upwiz-license-external', 'Flickr', licenseName );
 53+ }
5254 }
5355 }
5456 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87002initial partially functioning version of FlickrCheckerkaldari07:00, 27 April 2011

Status & tagging log