Api: Missing preloadparams

* Tiny fix to 33dc60838c for PHP variable name
* Bigger fix to properly pass preloadparams in and split them up

Change-Id: I844db115f2563cb9ee1629c30d5f49d1ce58f5bd
This commit is contained in:
David Lynch 2017-09-25 10:56:42 -05:00
parent 69092c4b6c
commit 02c6e9142b
2 changed files with 5 additions and 3 deletions

View file

@ -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,
],
];
}

View file

@ -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
} );