Page MenuHomePhabricator

"Argument 1 passed to User::equals() must implement interface MediaWiki\User\UserIdentity, null given"
Open, Needs TriagePublicPRODUCTION ERROR

Description

What is the problem?

Accessing some pages in the PageTriage queue returns:

[9e844a0e-087c-446e-9ba5-b1cef50d2665] /wiki/Conflict-title-0.8208880479427774-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n TypeError from line 4399 of /srv/mediawiki/php-1.36.0-wmf.18/includes/user/User.php: Argument 1 passed to User::equals() must implement interface MediaWiki\User\UserIdentity, null given, called in /srv/mediawiki/php-1.36.0-wmf.18/extensions/PageTriage/includes/Hooks.php on line 436

Backtrace:

#0 /srv/mediawiki/php-1.36.0-wmf.18/extensions/PageTriage/includes/Hooks.php(436): User->equals(NULL)
#1 /srv/mediawiki/php-1.36.0-wmf.18/includes/HookContainer/HookContainer.php(333): MediaWiki\Extension\PageTriage\Hooks::onArticleViewFooter(Article, boolean)
#2 /srv/mediawiki/php-1.36.0-wmf.18/includes/HookContainer/HookContainer.php(140): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#3 /srv/mediawiki/php-1.36.0-wmf.18/includes/HookContainer/HookRunner.php(880): MediaWiki\HookContainer\HookContainer->run(string, array)
#4 /srv/mediawiki/php-1.36.0-wmf.18/includes/page/Article.php(1127): MediaWiki\HookContainer\HookRunner->onArticleViewFooter(Article, boolean)
#5 /srv/mediawiki/php-1.36.0-wmf.18/includes/page/Article.php(811): Article->showViewFooter()
#6 /srv/mediawiki/php-1.36.0-wmf.18/includes/actions/ViewAction.php(74): Article->view()
#7 /srv/mediawiki/php-1.36.0-wmf.18/includes/MediaWiki.php(532): ViewAction->show()
#8 /srv/mediawiki/php-1.36.0-wmf.18/includes/MediaWiki.php(316): MediaWiki->performAction(Article, Title)
#9 /srv/mediawiki/php-1.36.0-wmf.18/includes/MediaWiki.php(945): MediaWiki->performRequest()
#10 /srv/mediawiki/php-1.36.0-wmf.18/includes/MediaWiki.php(548): MediaWiki->main()
#11 /srv/mediawiki/php-1.36.0-wmf.18/index.php(53): MediaWiki->run()
#12 /srv/mediawiki/php-1.36.0-wmf.18/index.php(46): wfIndexMain()
#13 /srv/mediawiki/w/index.php(3): require(string)
#14 {main}

I think it happens when the first revision on a page is deleted.

Line 436 of PageTriage/includes/Hooks.php is:

!$user->equals( $revStore->getFirstRevision( $title )->getUser() )
Steps to reproduce problem
  1. Login to https://test.wikipedia.org with a user who has PageTriage rights
  2. Go to https://test.wikipedia.org/wiki/Conflict-title-0.8208880479427774-I%C3%B1t%C3%ABrn%C3%A2ti%C3%B4n%C3%A0liz%C3%A6ti%C3%B8n

Expected behavior: Page loads, shows the PageTriage panel.
Observed behavior: Above exception.

Environment

Wiki(s): https://test.wikipedia.org MediaWiki 1.36.0-wmf.18 (0fecdd2) 00:26, 25 November 2020, PageTriage 0.3.0 (ad84bfe) 07:34, 6 November 2020.

Event Timeline

Restricted Application added a project: Growth-Team. · View Herald TranscriptDec 1 2020, 1:50 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
DannyS712 changed the subtype of this task from "Bug Report" to "Production Error".Dec 1 2020, 3:02 PM

Caused by the name of the editor of the first revision being revision-deleted, resulting in RevisionRecord::getUser returning null

Change 644491 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/PageTriage@master] Hooks: Use RevisionRecord::RAW to get the page creator's name

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

Change 644491 merged by jenkins-bot:
[mediawiki/extensions/PageTriage@master] Hooks: Use RevisionRecord::RAW to get the page creator's name

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