mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-09-24 10:49:29 +00:00
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:
parent
aaa1841580
commit
05c83e5212
|
@ -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 ];
|
||||
|
|
Loading…
Reference in a new issue