User:Liangent/cat-redir

From MediaWiki.org
Jump to navigation Jump to search

cat-redir | wb-lang (dev) | webfonts-cjk

Copying from Mentorship programs/Possible projects#Automatic category redirects:

Wikipedia Double Redirect.svg

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 JobQueue, the database schema, and LinksUpdate 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.

About me

Liangent (talk | global | mail | irc | gerrit | gerrit-review).

Preference

I'm submitting two proposals: one for the category redirects idea, and another for the wiki(base|data) language fallback & conversion idea. Actually I like to do either, and hope that another one can be done by someone else, because both of them resolve problems for our (zhwp) community. Since the first one has been listed on our idea list page, it's more likely that some other student wants to choose it too, and in this case I can do the fallback one.

From talk with my possible mentors, I learnt that Bawolff wants to implement category redirects themself if there's no student, and in Denny's plan language fallback is not something scheduled for short-term development. So if both projects give me a chance I'd like to do the Wikibase one. Besides the availablity of mentors, another reason is that new data are added to Wikidata rapidly these days. If language fallback is not handled properly, we may need more cleanup work to do in the future after people put duplicated data into multiple languages and / or variants, creating the same scenario as the one when LanguageConverter was initially created on zhwiki.

For above reasons, the main proposal is wikibase language work, and category redirects one is kept as a backup.

Technical notes[edit]

  • 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 / Works to do[edit]

  • 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?
  • 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: bugzilla: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[edit]

  • Before mid-term: have initial coding work done.
  • Mid-term: have code submitted for review (by others), writing mid-term evaluations.
  • After mid-term: have it deployed on various test wikis (and / or mw.org), test and fix problems.
  • Before final: have it deployed on other wikis.
  • Final: write report based on its working status on live sites.