From 02c6e9142bda0ccb50408340c8ea1c2961b69b86 Mon Sep 17 00:00:00 2001 From: David Lynch Date: Mon, 25 Sep 2017 10:56:42 -0500 Subject: [PATCH] Api: Missing preloadparams * Tiny fix to 33dc60838cbb8fc1c78678230c4516c1a36c23b3 for PHP variable name * Bigger fix to properly pass preloadparams in and split them up Change-Id: I844db115f2563cb9ee1629c30d5f49d1ce58f5bd --- ApiVisualEditor.php | 6 ++++-- .../init/targets/ve.init.mw.DesktopArticleTarget.init.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php index d337cabe21..179d893728 100644 --- a/ApiVisualEditor.php +++ b/ApiVisualEditor.php @@ -162,7 +162,7 @@ class ApiVisualEditor extends ApiBase { $content = $content->preloadTransform( $preloadTitle, $parserOptions, - $params['preloadparams'] + (array)$params )->serialize(); if ( $parse ) { @@ -716,7 +716,9 @@ class ApiVisualEditor extends ApiBase { 'editintro' => null, 'pst' => false, 'preload' => null, - 'preloadparams' => null, + 'preloadparams' => [ + ApiBase::PARAM_ISMULTI => true, + ], ]; } diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js index f380ed6b5c..811f8d2741 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js @@ -252,7 +252,7 @@ targetName: 'article', // ve.init.mw.DesktopArticleTarget.static.name modified: modified, preload: uri.query.preload, - preloadparams: uri.query.preloadparams, + preloadparams: uri.query[ 'preloadparams[]' ], // If switching to visual, check if we have wikitext to convert wikitext: mode === 'visual' ? $( '#wpTextbox1' ).textSelection( 'getContents' ) : undefined } );