Fix renaming of parameters to another existing name

If the user tried to rename a parameter to "asd", but "asd" already existed,
we'd append "asd0", and the user would get "asdasd0". But what we actually
wanted to do was change it to "asd0".

Change-Id: I7fa05ed6fca54bc941e1843ebe6872a87383effb
This commit is contained in:
Alex Monk 2016-08-16 01:59:18 +01:00
parent aaa1841580
commit 05c83e5212

View file

@ -709,7 +709,7 @@ mw.TemplateData.Model.prototype.setParamProperty = function ( paramKey, prop, va
// See if the parameters already has something with this new key
if ( this.params[ value ] && !this.params[ value ].deleted ) {
// Change the key to be something else
value += this.getNewValidParameterKey( value );
value = this.getNewValidParameterKey( value );
}
// Copy param details to new name
this.params[ value ] = this.params[ oldValue ];