Fix object vs. array initialization in template search

The "redirects" part in a prefixsearch query is always an
array, no matter if formatversion 1 or 2 is used.

The "pages" part is an object with formatversion 1, and an
array with formatversion 2.

As of now this always uses formatversion 1. This is
hard-coded in the upstream TitleWidget class.

Change-Id: I8cde8e104f8a288015da745db41016f6639b453b
This commit is contained in:
Thiemo Kreuz 2021-05-21 11:19:41 +02:00
parent 4f0c564fbc
commit b7043d6f24

View file

@ -77,7 +77,7 @@ ve.ui.MWTemplateTitleInputWidget.prototype.getLookupRequest = function () {
return promise
.then( function ( response ) {
var xhr, pageId, redirIndex,
redirects = ( response.query && response.query.redirects ) || {},
redirects = ( response.query && response.query.redirects ) || [],
origPages = ( response.query && response.query.pages ) || {},
newPages = [],
titles = [];