Page MenuHomePhabricator

cloner.js should not pass multiple nodes to OO.ui.infuse
Closed, ResolvedPublic

Description

cloner.js selects create buttons by class and passes them all to OO.ui.infuse: https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/e9e784a09e9dce43b832225945b2d57f7a2bde01/resources/src/mediawiki.htmlform/cloner.js#32

This causes problems when there are multiple cloner fields on the page: the data for the first create button overwrites the subsequent create buttons (see T270960 for details).

This caused problems while working on T208687: Convert SecurePoll to use OOUI, since there are multiple create buttons on the CreatePage form.

Event Timeline

If this is related to the OOUI variant of HTMLFormFieldCloner, then T206905: OOUI HTMLFormFieldCloner focusses on the incorrect field when that field has been added by JS might be worth fixing at the same time.

Change 652613 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/core@master] cloner.js: Ensure only one create button is passed to OO.ui.infuse

https://gerrit.wikimedia.org/r/652613

Change 652613 merged by jenkins-bot:
[mediawiki/core@master] cloner.js: Ensure only one create button is passed to OO.ui.infuse

https://gerrit.wikimedia.org/r/652613

matmarex assigned this task to Tchanders.
matmarex subscribed.