User:Liangent/cat-redir

Copying from Mentorship programs/Possible projects:

This is one of the oldest and most voted MediaWiki feature requests. MediaWiki has a feature called redirects where one page can redirect to another. However they do not work for categories. In the ideal system, if Category A redirects to B, and someone puts page foo in category A, then the page should show up in category B. If Someone changes Category A to redirect to Category C, all the pages put in category C have to have their links moved from Category A to Category B.

This project would involve several of the "core" components of core MediaWiki including the, the database schema, and class. However it is quite self contained. This project would also be quite beneficial to several wiki projects, especially multilingual projects like Wikimedia Commons.

Skills: PHP. SQL would be helpful.

Mentors: Brian Wolff.

Technical notes

 * categorylinks table must be updated on redirection. Don't try to merge category contents on display - otherwise it breaks sorting and/or makes category view expensive.

Things to consider

 * Redirect creation and removals.
 * Edits adding and removing pages from / to redirected categories.
 * Redirects from category to other pages (and the other way) should be forbidden.
 * Handle existing redirects correctly (with a maintence script?), including:
 * Currently non-working category redirects used as shortcuts (see zh:CAT:CSD, where CAT is a namespace alias of Category).
 * Cross-namespace redirects.
 * The current limitation of 'move' on categories should be lifted, with proper redirect handling.
 * It looks nasty that we need to re-parse every page in the (former) target category if a redirect is removed (changed to non-redirect or deleted).
 * Otherwise it's unable to identify exact category names specified by user (in wikitext).
 * Or add a column in categorylinks called 'cl_to_plain' to store the name specified by user?
 * This can be also useful for LanguageConverter-converted category names...
 * Double redirects (doesn't need to implement it but the system shouldn't explode when some people create them).
 * In conjunction with my chinese-collation branch: 44667.
 * A better UI to create / edit redirects (as a generic issue instead of a category-specific one).
 * The case that a redirect is changed again when the previous redirect change is being processed must be check correctly.
 * A FIFO job queue *MIGHT* (but doesn't always) help.
 * Extension:Renameuser suffers the same issue but its number of users is really limited (normally beaurecrats only) so we can just tell them not to create such cases.
 * Rendering of pages placed in redirected categories (which name to show? with what style? italic? red when redirect target is missing?).
 * Parser functions such as { {PAGESINCATEGORY: }}, especially when applied on redirected category names.
 * Compatibility of existing extensions (Extension:CategoryTree, Extension:DynamicPageList, etc.).
 * Solution to this issue might be useful for LanguageConverter too (there's something similar to category redirects in LanguageConverter already, see above).

Timeline

 * May 27, 1900 UTC: Announced
 * June 17: Beginning
 * July 29, 1900 UTC - August 2, 1900 UTC: Mid-term
 * September 16 / September 23, 0900 UTC - September 27, 1900 UTC: Final