Page MenuHomePhabricator

Gadgets and common.js things which touch the statement section do not work reliably anymore
Closed, ResolvedPublic


Since early August, I've been having problems with gadgets and the parts of my common.js not working properly on the first load of a page. It only seems to affect things which touch the statements section of the page. Before things suddenly broke in August, I had never ever had a problem, all the gadgets I used and all the stuff in my common.js worked fine every single time.

The most noticeable effect I'm aware of is that if you use a script for sorting statements (not an official gadget, User:Soulkeeper/statementSort.js seems to be the most common), the pages often end up a complete mess until you refresh, as I described on
When I have statement sorting enabled, I have to refresh the page on almost every item I load to get it to load properly (and it almost always loads perfectly fine after a refresh).

I tried disabling statement sorting but I still have problems, just not quite as obvious. For example, I have a very simple bit of code in my common.js which makes "0 references" red and if I click "Random item" a few times, sometimes "0 references" turns red, sometimes it doesn't (as with statement sorting, refreshing almost always fixes it). I have the DuplicateReferences gadget enabled too and the same thing happens there, sometimes it loads, sometimes it doesn't and refreshing almost always fixes it.

I've occasionally had problems with the AuthorityControl gadget not creating links properly. It seems to be behaving right now for me, but I have seen people asking where the links went, e.g. and - I can't say for sure if they're having the same problem as me, but it's possible.

I don't use DraggableSitelinks, but the discussion on suggests it also broke at the same time.

Event Timeline

Nikki created this task.Oct 17 2015, 9:17 PM
Nikki raised the priority of this task from to Needs Triage.
Nikki updated the task description. (Show Details)
Nikki added a project: Wikidata.
Nikki added a subscriber: Nikki.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 17 2015, 9:17 PM
Mineo added a subscriber: Mineo.Oct 18 2015, 2:29 PM
Nikki added a comment.Dec 3 2015, 8:07 PM

There are more reports of the AuthorityControl gadget not working consistently at

Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptDec 3 2015, 8:07 PM

This will propably be somehow improved after T95649: Create and document a stable framework for extending the Wikibase UI. The AuthorityControl gadget will go out very soon as the identifiers are going to be introduced.

Sjoerddebruin moved this task from Backlog to Bugs on the Wikidata-Gadgets board.Feb 23 2016, 10:38 AM
Nikki added a comment.Jun 7 2016, 8:59 AM

A while ago (I forget when), there was some change (something to do with how the HTML is rendered I think) and since then I've noticed that using a statement sorting script no longer corrupts the page.

However, the general problem still remains, I'm missing links for coordinates on many pages unless I refresh and the things in my common.js which touch the statement section usually fail to apply unless I refresh.

And people are still reporting issues with the Commons category links:

Nikki closed this task as Resolved.Jul 16 2018, 1:54 PM

The hook wikibase.entityPage.entityView.rendered was added in T189599 which can be used when scripts need to run after the page has rendered, so this now fixed.