Page MenuHomePhabricator

"TypeError: undefined is not an object (evaluating 'mw.util.addPortletLink')" while opening item in new tab (on background) in Safari
Closed, ResolvedPublic

Description

  1. Open https://www.wikidata.org/wiki/Wikidata:Database_reports/without_claims_by_site/nlwiki
  2. Open one of the items in a new tab (on the background)
  3. Notice that the Javascript doesn't load (there are some moments that it does load, select another item then)
  4. Check the Javascript console and see "TypeError: undefined is not an object (evaluating 'mw.util.addPortletLink')"

This doesn't seems to happen when I'm not logged in and only when using gadgets that use wbEntityId.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I think that I experience these issues, but I'm not loading the script reasonator.js. I wonder if this is really a problem of the JavaScript, since my HTML code doesn't even have the string "Add a new statement" until I reload the page. Are your issues and mine different, @Sjoerddebruin?

Krinkle claimed this task.
Krinkle subscribed.

mw.util.addPortletLink is a method of the mw.util singleton, which needs to be ensured by any code that uses it by declaring a deepndency on mediawiki.util.

When that is done, the system automatically makes sure that that is loaded before executing the rest of the code. This is working as intended.

I can not reproduce this in background tabs in Safari, Firefox or Chrome. If you see it again, please create a new task, and ideally with a "stack trace". You can find the stack trace by clicking the < triangle next to the error message. This will help us find which extension or which gadget is causing the problem.