Page MenuHomePhabricator

Add Special page to redirect to homepage or a specific entity
Closed, ResolvedPublic2 Estimated Story Points

Description

Problem

The homepage and the paths to individual entities are defined by configuration. Configuration settings can't be referenced directly in i18n messages. This makes it hard to link to the wishlist pages from within the code.

Additionally, as an editor, one might forget the path to the wishlist, or want a way to link that works across all installations of CommunityRequests.

Acceptance criteria

  • Create Special:Wishlist (and the alias Special:CommunityWishlist) that redirects to the homepage.
  • When given a wikitext value (i.e Special:Wishlist/W123 or Special:Wishlist/FA4), it should redirect to the specified entity page

Derived Requirement
Create a special page named Special:Wishlist (with alias Special:CommunityWishlist) that automatically redirects to the configured Community Wishlist homepage. When a subpage value is provided (e.g., Special:Wishlist/W123 or Special:Wishlist/FA4), the special page must redirect to the corresponding entity page based on configuration, ensuring consistent navigation across all installations without requiring direct config references in i18n messages.

Test Steps

Test Case 1: Redirect Special:Wishlist to the Wishlist Homepage

  1. Navigate to Special:Wishlist on the wiki.
  2. Observe the resulting page.
  3. ✅❓❌⬜ AC1: Confirm that the page redirects to the configured Community Wishlist homepage.

Test Case 2: Redirect Special:CommunityWishlist to the Wishlist Homepage

  1. Navigate to Special:CommunityWishlist.
  2. Observe the resulting page.
  3. ✅❓❌⬜ AC2: Confirm that it redirects to the same homepage as Special:Wishlist.

Test Case 3: Redirect to a Wish Entity Page (e.g., W123)

  1. Navigate to Special:Wishlist/W123.
  2. Observe the redirected page.
  3. ✅❓❌⬜ AC3: Confirm that it redirects to the entity page for wish W123.

Test Case 4: Redirect to a Focus Area Entity Page (e.g., FA4)

  1. Navigate to Special:Wishlist/FA4.
  2. Observe the redirected page.
  3. ✅❓❌⬜ AC4: Confirm that it redirects to the entity page for focus area FA4.

Test Case 5: Support for Unknown or Invalid Entities

  1. Navigate to Special:Wishlist/Invalid123.
  2. Observe the handling behavior.
  3. ✅❓❌⬜ AC5: Confirm that the system applies the standard invalid-entity handling (e.g., showing an error or standard not-found page), with no unexpected failures.

QA Results - Meta Beta

Event Timeline

MusikAnimal changed the task status from Open to In Progress.
MusikAnimal triaged this task as Low priority.

Change #1215425 had a related patch set uploaded (by MusikAnimal; author: MusikAnimal):

[mediawiki/extensions/CommunityRequests@master] SpecialWishlist: add handy means to redirect to homepage or entities

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

Change #1215425 merged by jenkins-bot:

[mediawiki/extensions/CommunityRequests@master] SpecialWishlist: add handy means to redirect to homepage or entities

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

@MusikAnimal Can you please review AC5? Is it supposed to redirect to the homepage, display an error, or indicate that it doesn't exist?

UPDATE: ✅ T411844#11441373

Test Result - Meta Beta

Status: ✅ PASS
Environment:Meta Beta
OS: macOS Tahoe 26.1
Browser: Chrome 142
Device: MBA
Emulated Device: NA

Test Artifact(s):

https://meta.wikimedia.beta.wmcloud.org/wiki/Special:Wishlist
https://meta.wikimedia.beta.wmcloud.org/wiki/Special:CommunityWishlist
https://meta.wikimedia.beta.wmcloud.org/wiki/Special:Wishlist/W33
https://meta.wikimedia.beta.wmcloud.org/wiki/Special:Wishlist/FA14
https://meta.wikimedia.beta.wmcloud.org/wiki/Special:Wishlist/Invalid123

Test Steps

Test Case 1: Redirect Special:Wishlist to the Wishlist Homepage

  1. Navigate to Special:Wishlist on the wiki.
  2. Observe the resulting page.
  3. AC1: Confirm that the page redirects to the configured Community Wishlist homepage.

Test Case 2: Redirect Special:CommunityWishlist to the Wishlist Homepage

  1. Navigate to Special:CommunityWishlist.
  2. Observe the resulting page.
  3. AC2: Confirm that it redirects to the same homepage as Special:Wishlist.

Test Case 3: Redirect to a Wish Entity Page (e.g., W33)

  1. Navigate to Special:Wishlist/W123.
  2. Observe the redirected page.
  3. AC3: Confirm that it redirects to the entity page for wish W33.

Test Case 4: Redirect to a Focus Area Entity Page (e.g., FA14)

  1. Navigate to Special:Wishlist/FA4.
  2. Observe the redirected page.
  3. AC4: Confirm that it redirects to the entity page for focus area FA14.

Test Case 5: Support for Unknown or Invalid Entities

  1. Navigate to Special:Wishlist/Invalid123.
  2. Observe the handling behavior.
  3. AC5: Confirm that the system applies the standard invalid-entity handling (e.g., showing an error or standard not-found page), with no unexpected failures.

UPDATE: ✅ T411844#11441373

A RedirectSpecialPage class, as it is called, must always redirect. So the idea is to simply redirect to the homepage if given something invalid. We could throw an exception I suppose and catch it, showing an error similar to what you'd see with Special:WishlistIntake/Invalid, but this adds a lot of complexity for little gain, methinks. The main purpose of Special:Wishlist is for internal use in i18n messages, anyway.

GMikesell-WMF updated the task description. (Show Details)