Page MenuHomePhabricator

Prevent multiple 'titles' inputs for featured templates
Closed, ResolvedPublic

Description

Currently, it's possible to add multiple titles inputs, where each is a list of featured templates. The form does not allow you to save (it shows an error: "More than one property in FeaturedTemplates. Key: FeaturedTemplates"), but it shouldn't give the option.

image_2025-06-22_093959568.png (587×1 px, 36 KB)

The 'Add another element' button should not be shown if there is already one element.

Reported by @Escargot_rouge at T392896#10936457

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Samwilson renamed this task from Prevent multiple 'titles inputs for featured templates to Prevent multiple 'titles' inputs for featured templates.Jun 23 2025, 6:25 AM

Change #1165895 had a related patch set uploaded (by Samtar; author: Samtar):

[mediawiki/extensions/TemplateData@master] [WIP] ext.templateData.templateDiscovery: Prevent multiple 'titles' elements

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

If there is always one and only one title field, it would probably be simpler to display this field directly, instead of requiring the user to click on Add another element, as is done, for example, with the first field on https://test.wikipedia.org/wiki/Special:CommunityConfiguration/GrowthSuggestedEdits.

KSiebert changed the task status from Open to In Progress.Jul 16 2025, 9:40 AM

Change #1177983 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/TemplateData@master] Featured templates: add messages, and set max/min field count

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

Change #1177983 merged by jenkins-bot:

[mediawiki/extensions/TemplateData@master] Featured templates: add messages, and set max/min field count

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

it would probably be simpler to display this field directly, instead of requiring the user to click on Add another element

That's very true, and we should sort that out. For now though, at least it's no longer possible to add extra titles elements.

Change #1165895 abandoned by Samtar:

[mediawiki/extensions/TemplateData@master] ext.templateData.templateDiscovery: Prevent multiple 'titles' elements

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

dom_walden subscribed.

I see the "Add another element" button is disabled on enwiki beta.