Page MenuHomePhabricator

Error when trying to access IPInfo popup: mw.user.getRights is undefined
Closed, ResolvedPublic1 Estimated Story Points

Description

Background

When attempting to access the IPInfo popup, some devs are seeing an error that the function mw.user.getRights is undefined.

mw.user.getRights is defined in mediawiki.user.js, which is loaded in the module mediawiki.user, defined here in Resources.php: https://gerrit.wikimedia.org/g/mediawiki/core/+/5250bab937083979880e01ca2414ef71267dffb7/resources/Resources.php#1213

IPInfo's module ext.ipInfo uses getRights here: https://gerrit.wikimedia.org/g/mediawiki/extensions/IPInfo/+/13ffefdb4341b614c5765f1438d2a13982529f1a/modules/ext.ipInfo/log.js#32

ext.ipInfo should therefore have a dependency on mediawiki.user.

Acceptance criteria
Background reading
Testing notes
  • To test on Special:Log, just visit Special:Log and click on an (i) button next to an IP address. IP information should appear in the popup, with no errors.
  • To test on a history page, go to an article page and click on the history link (top right). Click on an (i) button next to an IP address who has edited the page. IP information should appear in the popup, with no errors.

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptOct 19 2022, 4:05 PM

FAO @Cyndymediawiksim and @TThoabala, who have both experienced this. Could you possibly add which page(s) you experienced it from?

Tchanders set the point value for this task to 1.Oct 19 2022, 4:07 PM

Change 844505 had a related patch set uploaded (by TsepoThoabala; author: TsepoThoabala):

[mediawiki/extensions/IPInfo@master] Error when trying to access IPInfo popup: mw.user.getRights is undefined

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

FAO @Cyndymediawiksim and @TThoabala, who have both experienced this. Could you possibly add which page(s) you experienced it from?

This is happening on Special:Log and history page.

Change 844505 merged by jenkins-bot:

[mediawiki/extensions/IPInfo@master] Add mediawiki.user to list of dependencies

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

dom_walden added a subscriber: dom_walden.

I did a fresh install of mediawiki core + IPInfo.

Checking out the parent commit and opening the popup for revision history and logs, I got the jQuery.Deferred exception: mw.user.getRights is not a function error and popup displayed a red error.

Checking out the latest commit, I did not get an error and the popup displayed the information.

Test environment: local docker IP Info 0.0.0 (275ac37) 08:45, 31 October 2022.