Page MenuHomePhabricator

Looking at deleted versions gives an internal error as checkuser
Closed, ResolvedPublicPRODUCTION ERROR

Description

When I try to look at deleted revisions of a page, for example https://nl.wikipedia.org/w/index.php?title=Gebruiker:Victordeguide&action=edit&redlink=1 I get:

[WXZUuwpAEKsAAFRi1EoAAAAA] 2017-07-24 20:12:43: Fatale fout van type "BadMethodCallException"

Asking around, a fellow checkuser got the same error, a moderator could just see them.

On nlwiki we have a different setup with CU's as they are not moderators. This works weil, but it can be handy to see deleted pages, so the checkuser right is extended with rights to view deleted pages.

Seems that something changed not effecting moderators with full rights, but does effect checkusers.

Event Timeline

Reedy subscribed.
2017-07-24 20:12:43 [WXZUuwpAEKsAAFRi1EoAAAAA] mw1216 nlwiki 1.30.0-wmf.10 exception ERROR: [WXZUuwpAEKsAAFRi1EoAAAAA] /wiki/Speciaal:Terugplaatsen/Gebruiker:Victordeguide   BadMethodCallException from line 863 of /srv/mediawiki/php-1.30.0-wmf.10/includes/specials/SpecialUndelete.php: Call to a member function appendContent() on a non-object (null) {"exception_id":"WXZUuwpAEKsAAFRi1EoAAAAA","caught_by":"mwe_handler"}
[Exception BadMethodCallException] (/srv/mediawiki/php-1.30.0-wmf.10/includes/specials/SpecialUndelete.php:863) Call to a member function appendContent() on a non-object (null)
  #0 /srv/mediawiki/php-1.30.0-wmf.10/includes/specials/SpecialUndelete.php(207): SpecialUndelete->showHistory()
  #1 /srv/mediawiki/php-1.30.0-wmf.10/includes/specialpage/SpecialPage.php(522): SpecialUndelete->execute(string)
  #2 /srv/mediawiki/php-1.30.0-wmf.10/includes/specialpage/SpecialPageFactory.php(578): SpecialPage->run(string)
  #3 /srv/mediawiki/php-1.30.0-wmf.10/includes/MediaWiki.php(287): SpecialPageFactory::executePath(Title, RequestContext)
  #4 /srv/mediawiki/php-1.30.0-wmf.10/includes/MediaWiki.php(867): MediaWiki->performRequest()
  #5 /srv/mediawiki/php-1.30.0-wmf.10/includes/MediaWiki.php(523): MediaWiki->main()
  #6 /srv/mediawiki/php-1.30.0-wmf.10/index.php(43): MediaWiki->run()
  #7 /srv/mediawiki/w/index.php(3): include(string)
  #8 {main}

Logic looks convoluted.

$form is only defined in one conditional if ( $this->mAllowed ) {

The same conditional exists near the bottom, but $form is used outside it

		if ( $this->mAllowed ) {
			# Slip in the hidden controls here
			$misc = Html::hidden( 'target', $this->mTarget );
			$misc .= Html::hidden( 'wpEditToken', $this->getUser()->getEditToken() );
			$history .= $misc;
		}

		$form->appendContent( new OOUI\HtmlSnippet( $history ) );

to

		if ( $this->mAllowed ) {
			# Slip in the hidden controls here
			$misc = Html::hidden( 'target', $this->mTarget );
			$misc .= Html::hidden( 'wpEditToken', $this->getUser()->getEditToken() );
			$history .= $misc;
			$form->appendContent( new OOUI\HtmlSnippet( $history ) );
		}

seems more appropriate....

Change 367562 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[mediawiki/core@master] SpecialUndelete: Don't try to add a form to the page unless it exists

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

		if ( $this->mAllowed ) {
			# Slip in the hidden controls here
			$misc = Html::hidden( 'target', $this->mTarget );
			$misc .= Html::hidden( 'wpEditToken', $this->getUser()->getEditToken() );
			$history .= $misc;
			$form->appendContent( new OOUI\HtmlSnippet( $history ) );
		}

seems more appropriate....

We're supposed to display $history even if the user is not allowed to undelete (only view). Otherwise we'd fix the exception, but checkusers still wouldn't be able to see it :D I updated the proposed patch.

Framawiki renamed this task from Looking at deleted versions gives an internal error as checkuser on nlwikipedia to Looking at deleted versions gives an internal error as checkuser.Jul 25 2017, 9:33 PM

Change 367810 had a related patch set uploaded (by Reedy; owner: Jforrester):
[mediawiki/core@wmf/1.30.0-wmf.10] SpecialUndelete: Don't try to add a form to the page unless it exists

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

Change 367811 had a related patch set uploaded (by Reedy; owner: Jforrester):
[mediawiki/core@wmf/1.30.0-wmf.11] SpecialUndelete: Don't try to add a form to the page unless it exists

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

Change 367562 merged by jenkins-bot:
[mediawiki/core@master] SpecialUndelete: Don't try to add a form to the page unless it exists

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

Change 367810 merged by jenkins-bot:
[mediawiki/core@wmf/1.30.0-wmf.10] SpecialUndelete: Don't try to add a form to the page unless it exists

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

Change 367811 merged by jenkins-bot:
[mediawiki/core@wmf/1.30.0-wmf.11] SpecialUndelete: Don't try to add a form to the page unless it exists

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

Mentioned in SAL (#wikimedia-operations) [2017-07-25T22:12:54Z] <reedy@tin> Synchronized php-1.30.0-wmf.10/includes/specials/SpecialUndelete.php: T171523 (duration: 00m 47s)

Mentioned in SAL (#wikimedia-operations) [2017-07-25T22:14:20Z] <reedy@tin> Synchronized php-1.30.0-wmf.11/includes/specials/SpecialUndelete.php: T171523 (duration: 00m 46s)

This should now be fixed. Sorry, all.

Thanks all, very quick turnaround. Works for me again.

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:10 PM