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.