mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Skip bad suggestedvalues and aliases in the template dialog
Bug: T297386 Change-Id: I6456d720c923e8cff9b4500b6cfe52bc6fbc9dad
This commit is contained in:
parent
887a01a355
commit
66636e1dd8
|
@ -338,7 +338,10 @@ ve.ui.MWParameterPage.prototype.createValueInput = function () {
|
|||
) {
|
||||
valueInputConfig.menu = { filterFromInput: true, highlightOnFilter: true };
|
||||
valueInputConfig.options =
|
||||
this.parameter.getSuggestedValues().map( function ( suggestedValue ) {
|
||||
this.parameter.getSuggestedValues().filter( function ( suggestedValue ) {
|
||||
// This wasn't validated for a while, existing templates can do anything here
|
||||
return typeof suggestedValue === 'string';
|
||||
} ).map( function ( suggestedValue ) {
|
||||
return { data: suggestedValue };
|
||||
} );
|
||||
this.rawValueInput = true;
|
||||
|
|
|
@ -256,7 +256,8 @@ ve.ui.MWTransclusionOutlineTemplateWidget.prototype.filterParameters = function
|
|||
].concat( spec.getParameterAliases( paramName ) );
|
||||
|
||||
var foundSomeMatch = placesToSearch.some( function ( term ) {
|
||||
return term && term.toLowerCase().indexOf( query ) !== -1;
|
||||
// Aliases missed validation for a long time and aren't guaranteed to be strings
|
||||
return term && typeof term === 'string' && term.toLowerCase().indexOf( query ) !== -1;
|
||||
} );
|
||||
|
||||
item.toggle( foundSomeMatch );
|
||||
|
|
Loading…
Reference in a new issue