Page MenuHomePhabricator

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

Description

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 https://www.wikidata.org/wiki/Wikidata:Contact_the_development_team/Archive/2015/08#Values.2Fqualifiers_displayed_in_irrelevant_properties
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. https://www.wikidata.org/wiki/Wikidata:Project_chat/Archive/2015/08#Links_are_gone and https://www.wikidata.org/wiki/Wikidata:Project_chat#Formatter_URLs_broken.3F - 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 https://www.wikidata.org/wiki/MediaWiki_talk:Gadget-DraggableSitelinks.js suggests it also broke at the same time.

Event Timeline

Nikki raised the priority of this task from to Needs Triage.
Nikki updated the task description. (Show Details)
Nikki added a project: Wikidata.
Nikki subscribed.

There are more reports of the AuthorityControl gadget not working consistently at https://www.wikidata.org/wiki/Wikidata:Project_chat#Commons_category_format

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.

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: https://www.wikidata.org/wiki/Wikidata:Project_chat#Active_links_for_commons_categories

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.