From 33041b752d7c2638ba5a08668a16ea13f7db96b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Tue, 30 Aug 2016 18:49:27 +0200 Subject: [PATCH] mw.Upload.BookletLayout: Use 'amenableparser' to handle templates in error messages Depends-On: I7e1a52a59a25befe4edb7b4f531d60a2615e8f90 Bug: T144237 Change-Id: I022e1f178c5a10c440f7fddc73709a4e262c5801 --- .../mediawiki.Upload.BookletLayout.js | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) 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 -- 2.20.1