Page MenuHomePhabricator

Global Watchlist works wrong on Wikibase sites with items outside the main namespace
Closed, ResolvedPublicBUG REPORT

Description

Working on T373686: [MUL] Show default labels on the global watchlist I spent a day to understand why every part of the code works, but the code doesn't (vs. 20 minutes for actually coding the task solution). The answer is that the current code does not know that there are Wikibase sites with the Item namespace differs from 0 (where it stands in Wikidata). As a result, for each such a site the extension doesn't show item labels.

To reproduce it:

  • Open the Global Watchlist with some Wikibase site that has Items outside the main namespace (I used Catalyst (PatchDemo) Wikibase, but it need adjustments, as far as I understand it does not have wgGlobalWatchlistWikibaseSite system variable set.)
  • Edit in private mode outside the account an item with a label in the user language.
  • Refresh the Global Watchlist.
  • Find the item name on the relevant line.
  • Expected: Q<number> (<label>).
  • Got: Item:Q<number>.

On the other side, you got nothing if the watclist includes a wikitext page in the main namespace because the extension blows up.

The bug could be reproduced on Patch Demo very soon, when T415337: Recognize Wikibase when no wgGlobalWatchlistWikibaseSite system variable is set will be fixed.

Event Timeline

IKhitron triaged this task as Medium priority.Thu, Jan 22, 6:51 PM
IKhitron added a project: User-IKhitron.
IKhitron moved this task from Backlog to Coding on the User-IKhitron board.
IKhitron changed the task status from Open to Stalled.Fri, Jan 23, 6:43 AM
IKhitron updated the task description. (Show Details)

Will be reopened very soon, just after the fix for the T415337 will be merged to the master branch.

Change #1231413 had a related patch set uploaded (by IKhitron; author: IKhitron):

[mediawiki/extensions/GlobalWatchlist@master] Fix the code for Wikibase Items outside the main namespace

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

Test wiki created on Patch demo by IKhitron using patch(es) linked to this task:
https://d3de2fa625.catalyst.wmcloud.org/w/

Well, @Tacsipacsi, it took almost 4 hours, but works from the first try. I made everything you asked in T415337 comments. As I said, I don't want to open it to review oficially because that task does not merged yet, but this one is built on that one, and you're invited to review it from now on, if you're interested. The Patch Demo Alice account shows four edits: wikitext in main namespace, Item, Property and Property talk to be sure it doesn't mix prefixes. I also added by the same logic a fix for the case somebody decides to localize the Wikibase namespaces names. Thank you again for the ideas.

IKhitron changed the task status from Stalled to In Progress.Sun, Jan 25, 9:53 PM
IKhitron raised the priority of this task from Medium to High.
IKhitron moved this task from Gerrit WIP to Ready to review on the User-IKhitron board.

Change #1231413 merged by jenkins-bot:

[mediawiki/extensions/GlobalWatchlist@master] Fix the code for Wikibase Items outside the main namespace

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

IKhitron moved this task from Ready to review to Merged on the User-IKhitron board.