Page MenuHomePhabricator

Featured templates display in random order instead of configured order
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue

  • Set featured templates using Special:CommunityConfiguration/TemplateData-FeaturedTemplates
  • Templates are listed in the desired order, both on this page and in MediaWiki:FeaturedTemplates.json
  • Open the Template Wizard (either in VisualEditor or source editor), then go to the Featured tab
  • Tab displays the templates in a random order and the order changes after each page refresh

What happens?:
Featured templates are displayed in a random order in the Template Wizard

What should have happened instead?:
Featured templates are displayed in the order as they were defined in the JSON

Software version: 1.45.0-wmf.19

Affected wikis:


Derived Requirement

Ensure that featured templates displayed in the Template Wizard are shown in the exact order defined in MediaWiki:FeaturedTemplates.json.
The display order must be deterministic and consistent across page loads, editor modes (VisualEditor and source editor), and refreshes.
This requirement is derived from the expected behavior described in *“What should have happened instead?”*.

Test Result - Beta|Prod

Status: ✅ PASS / ❓Need More Info / ❌ FAIL
Environment: beta/enwiki
OS: macOS Tahoe 26.1
Browser: Chrome 142
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify featured templates display in configured order in VisualEditor

Preconditions:

  • Featured templates are configured via *Special:CommunityConfiguration/TemplateData-FeaturedTemplates*.
  • MediaWiki:FeaturedTemplates.json contains templates in a known, explicit order.
  1. Navigate to *Special:CommunityConfiguration/TemplateData-FeaturedTemplates*.
  2. Confirm the order of templates as listed and as stored in MediaWiki:FeaturedTemplates.json.
  3. Open any article in VisualEditor.
  4. Open the Template Wizard.
  5. Select the Featured tab.
  6. ✅❓❌⬜ AC1: Confirm featured templates are displayed in the same order as defined in MediaWiki:FeaturedTemplates.json.

Test Case 2: Verify featured templates order remains consistent after page refresh

  1. With the Template Wizard still open on the Featured tab, refresh the page.
  2. Reopen the Template Wizard and navigate back to the Featured tab.
  3. ✅❓❌⬜ AC2: Confirm the order of featured templates remains unchanged after refresh.

Test Case 3: Verify featured templates display in configured order in source editor

  1. Open an article using the source editor.
  2. Launch the Template Wizard.
  3. Navigate to the Featured tab.
  4. ✅❓❌⬜ AC3: Confirm featured templates are displayed in the same configured order as defined in the JSON.

QA Results -PROD

ACStatusDetails
1T405106#11474883
2T405106#11474883
3T405106#11474883

Event Timeline

Samwilson edited projects, added Community-Tech (Fox Squad); removed Community-Tech.
Samwilson subscribed.

The API is returning them in the same order: https://fr.wikipedia.org/w/api.php?action=query&format=json&meta=communityconfiguration&formatversion=2&ccrprovider=TemplateData-FeaturedTemplates&ccrassertversion=1.0.0

It looks like the error is that after retrieving that list we then make separate requests for each template's details, and those requests can come back out of order.

I'll fix this up.

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

[mediawiki/extensions/TemplateData@master] Fetch info of all featured templates at once

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

Change #1189948 merged by jenkins-bot:

[mediawiki/extensions/TemplateData@master] Fetch info of all featured templates at once

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

If I understand correctly, this change was merged and released, but the issue still persists on the de, nl, and hu wikis. On frwiki, however, it appears to respect the configured order now.

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

[mediawiki/extensions/TemplateData@master] Featured templates: re-order according to original order

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

Yes it looks like the frwiki case is a fluke of the desired order happening to match up with the page ID order of those templates! Oops. Sorry about this. Thanks for checking up on it!

I've made a fix that re-orders the action=templatedata API results to be in the same order as the original template titles that get retrieved from CommunityConfiguration.

No worries, thanks for the quick turnaround! :)

Change #1196987 merged by jenkins-bot:

[mediawiki/extensions/TemplateData@master] Featured templates: re-order according to original order

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

@Samwilson Do you know why I'm not seeing anything in the features tab like I was with Deutsch?

Test Result - Beta

Status: ❌ FAIL
Environment: Beta: 1.46.0-alpha (ebc6935) 16:02, 15 December 2025
OS: macOS Tahoe 26.1
Browser: Chrome 142
Device: MBA
Emulated Device: NA

Test Artifact(s):
https://en.wikipedia.beta.wmcloud.org/wiki/Bat-eared_fox
https://en.wikipedia.beta.wmcloud.org/wiki/Special:CommunityConfiguration/TemplateData-FeaturedTemplates
https://en.wikipedia.beta.wmcloud.org/wiki/MediaWiki:FeaturedTemplates.json

Test Steps

Test Case 1: Verify featured templates display in configured order in VisualEditor

Preconditions:

  • Featured templates are configured via *Special:CommunityConfiguration/TemplateData-FeaturedTemplates*.
  • MediaWiki:FeaturedTemplates.json contains templates in a known, explicit order.
  1. Navigate to *Special:CommunityConfiguration/TemplateData-FeaturedTemplates*.
  2. Confirm the order of templates as listed and as stored in MediaWiki:FeaturedTemplates.json.
  3. Open any article in VisualEditor.
  4. Open the Template Wizard.
  5. Select the Featured tab.
  6. ❌ AC1: Confirm featured templates are displayed in the same order as defined in MediaWiki:FeaturedTemplates.json.
VisualEditorSpecial:CommunityConfigurationMediaWiki:FeaturedTemplates.jsonDeutsch
2025-12-15_15-11-41.png (1×1 px, 284 KB)
2025-12-15_15-11-34.png (1×1 px, 180 KB)
2025-12-15_12-18-46.png (1×1 px, 299 KB)

Test Case 2: Verify featured templates order remains consistent after page refresh

  1. With the Template Wizard still open on the Featured tab, refresh the page.
  2. Reopen the Template Wizard and navigate back to the Featured tab.
  3. ❌ AC2: Confirm the order of featured templates remains unchanged after refresh.

Test Case 3: Verify featured templates display in configured order in source editor

  1. Open an article using the source editor.
  2. Launch the Template Wizard.
  3. Navigate to the Featured tab.
  4. AC3:** Confirm featured templates are displayed in the same configured order as defined in the JSON.

GMikesell-WMF changed the task status from Open to In Progress.Dec 15 2025, 11:19 PM
GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF moved this task from QA to In Development on the Community-Tech (Fox Squad) board.

Sorry @GMikesell-WMF this hasn't yet been deployed to production! So it's not on de.wikipedia.org yet. It'll go out on this week's train (i.e. will be on all wikis by 2025-12-18 19:00 UTC).

If you're happy with how it's working on Beta, that's probably good enough.

@Samwilson Confirmed that the featured templates display in the configured order, as seen in the videos below. I will mark this as Resolved. Thanks for all your work!

Test Result - PROD

Status: ✅ PASS
Environment: PROD
OS: macOS Tahoe 26.1
Browser: Chrome 143
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1: Verify featured templates display in configured order in VisualEditor

Preconditions:

  • Featured templates are configured via *Special:CommunityConfiguration/TemplateData-FeaturedTemplates*.
  • MediaWiki:FeaturedTemplates.json contains templates in a known, explicit order.
  1. Navigate to *Special:CommunityConfiguration/TemplateData-FeaturedTemplates*.
  2. Confirm the order of templates as listed and as stored in MediaWiki:FeaturedTemplates.json.
  3. Open any article in VisualEditor.
  4. Open the Template Wizard.
  5. Select the Featured tab.
  6. ✅ AC1: Confirm featured templates are displayed in the same order as defined in MediaWiki:FeaturedTemplates.json.
defrnlhu

Test Case 2: Verify featured templates order remains consistent after page refresh

  1. With the Template Wizard still open on the Featured tab, refresh the page.
  2. Reopen the Template Wizard and navigate back to the Featured tab.
  3. ✅ AC2: Confirm the order of featured templates remains unchanged after refresh.

See AC1

Test Case 3: Verify featured templates display in configured order in source editor

  1. Open an article using the source editor.
  2. Launch the Template Wizard.
  3. Navigate to the Featured tab.
  4. AC3:** Confirm featured templates are displayed in the same configured order as defined in the JSON.

See AC1

GMikesell-WMF updated the task description. (Show Details)
GMikesell-WMF updated Other Assignee, removed: GMikesell-WMF.