From: Bartosz DziewoƄski Date: Tue, 30 Aug 2016 16:49:27 +0000 (+0200) Subject: mw.Upload.BookletLayout: Use 'amenableparser' to handle templates in error messages X-Git-Tag: 1.31.0-rc.0~5783^2 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=33041b752d7c2638ba5a08668a16ea13f7db96b1;p=lhc%2Fweb%2Fwiklou.git mw.Upload.BookletLayout: Use 'amenableparser' to handle templates in error messages Depends-On: I7e1a52a59a25befe4edb7b4f531d60a2615e8f90 Bug: T144237 Change-Id: I022e1f178c5a10c440f7fddc73709a4e262c5801 --- diff --git a/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js b/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js index 31e4492d3a..920835f193 100644 --- a/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js +++ b/resources/src/mediawiki/mediawiki.Upload.BookletLayout.js @@ -345,15 +345,18 @@ if ( error.message ) { return this.upload.getApi() .then( function ( api ) { - return api.loadMessagesIfMissing( [ error.message.key ] ).then( function () { - if ( !mw.message( error.message.key ).exists() ) { - return $.Deferred().reject(); - } - return new OO.ui.Error( - $( '

' ).msg( error.message.key, error.message.params || [] ), - { recoverable: false } - ); - } ); + // 'amenableparser' will expand templates and parser functions server-side. + // We still do the rest of wikitext parsing here (throught jqueryMsg). + return api.loadMessagesIfMissing( [ error.message.key ], { amenableparser: true } ) + .then( function () { + if ( !mw.message( error.message.key ).exists() ) { + return $.Deferred().reject(); + } + return new OO.ui.Error( + $( '

' ).msg( error.message.key, error.message.params || [] ), + { recoverable: false } + ); + } ); } ) .then( null, function () { // We failed when loading the error message, or it doesn't actually exist, fall back