VisualEditor/NWE does not handle 'preloadparams' with explicit indexes.
To reproduce:
- Enable NWE in your preferences
- Visit this page (this will open the editor, don't save the edit): https://en.wikipedia.org/w/index.php?action=edit§ion=new&preloadtitle=Protected+edit+request+on+23+August+2019&editintro=Template%3AEdit+protected%2Feditintro&preload=Template%3ASubmit+an+edit+request%2Fpreload&title=Template_talk%3ASubmit_an_edit_request&preloadparams%5B0%5D=edit+fully-protected&preloadparams%5B1%5D=Template%3ASubmit+an+edit+request
Expected: the prefilled page content starts with {{edit fully-protected|Template:Submit an edit request|answered=no}}
Actual: the prefilled page content starts with {{$1|$2|answered=no}}
This works correctly in old wikitext editor.
The parameters can be given in implicit order, which works fine:
...&preloadparams[]=a&preloadparams[]=b
But also in explicit order, which we are not handling correctly:
...&preloadparams[0]=a&preloadparams[1]=b
Notably, core MediaWiki redirect special pages like Special:NewSection and Special:MyPage will generate URLs in the second format. I noticed the problem while testing the patch for T231088.