Category overlay in the MobileFrontend extension should refresh after a category was added to a page
MediaWiki has an extension called MobileFrontend which uses a skin called Minerva-Neue. You can see them in action when you go to (for example) https://m.mediawiki.org/ instead of https://www.mediawiki.org/ (note the "m" instead of "www" in the URL).
Steps to see the problem:
- Make sure you are on mobile beta.wmflabs.org and have categories: https://en.m.wikipedia.beta.wmflabs.org/wiki/CategoryTest?mobileaction=beta
- Navigate to https://en.wikipedia.beta.wmflabs.org/wiki/Dog
- Tap "Categories" at the bottom of the article
- Add the Dog article to the Pets Category
- Click "Save"
Problem to solve:
After adding the new category, the user does not see it in the list of categories until the user completely closes the categories page and returns back to categories again.
The problem is caused by the CategoryGateway
. The _loadCategories
function is called by the event handler, but the CategoryGateway
is saved as an instance variable of the class, so it has been used before.
When the event listener category-added
is called, the Gateway's property canContinue
is false because of the first call. The first call to the function getCategories
happened when the CategoryOverlay
was loaded at the start.
You are expected to provide a patch in Wikimedia Gerrit which re-renders the full template, plus also adds a testcase for this! See https://www.mediawiki.org/wiki/Gerrit/Tutorial for how to set up Git and Gerrit.
Please look at the Phabricator task for more information!