Page MenuHomePhabricator

Special:InvestigateBlock: "Undefined index: PreviousTarget" when trying to block self
Closed, ResolvedPublicOct 20 2020


What is the problem?

If using the Special:InvestigateBlock form to block your own user, an error appears in the logs:

[error] [05edc4a21f878a40811f9d17] /index.php/Special:InvestigateBlock   ErrorException from line 791 of /var/www/html/includes/specials/SpecialBlock.php: PHP Notice: Undefined index: PreviousTarget
#0 /var/www/html/includes/specials/SpecialBlock.php(791): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /var/www/html/extensions/CheckUser/src/SpecialInvestigateBlock.php(230): SpecialBlock::processForm(array, RequestContext)
#2 /var/www/html/includes/htmlform/HTMLForm.php(707): MediaWiki\CheckUser\SpecialInvestigateBlock->onSubmit(array, OOUIHTMLForm)
#3 /var/www/html/includes/htmlform/HTMLForm.php(597): HTMLForm->trySubmit()
#4 /var/www/html/includes/htmlform/HTMLForm.php(613): HTMLForm->tryAuthorizedSubmit()
#5 /var/www/html/includes/specialpage/FormSpecialPage.php(187): HTMLForm->show()
#6 /var/www/html/includes/specialpage/SpecialPage.php(600): FormSpecialPage->execute(NULL)
#7 /var/www/html/includes/specialpage/SpecialPageFactory.php(635): SpecialPage->run(NULL)
#8 /var/www/html/includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#9 /var/www/html/includes/MediaWiki.php(940): MediaWiki->performRequest()
#10 /var/www/html/includes/MediaWiki.php(543): MediaWiki->main()
#11 /var/www/html/index.php(53): MediaWiki->run()
#12 /var/www/html/index.php(46): wfIndexMain()
#13 {main}

This has no user facing impact that I can see. Instead of submitting, the form displays a (slightly confusing) validation message: No users were blocked. To override existing blocks, check: "Override existing blocks". A block will not be overridden if the new block is identical to the existing block.

I am also not sure why you would want to block yourself in these circumstances.

Steps to reproduce problem
  1. Login as an admin and go to Special:InvestigateBlock
  2. In the first field, enter your username
  3. Enter anything in "Reason"
  4. Submit

Expected behavior: Not exactly sure. Should we be able to block ourselves? Or should it display a message telling us we cannot block ourselves.
Observed behavior: Validation error as above.


Wiki(s): MediaWiki 1.36.0-alpha (2d7fe2d) 05:52, 14 July 2020; CheckUser 2.5 (12645d7) 19:37, 13 July 2020.

Event Timeline

Change 632906 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/extensions/CheckUser@master] SpecialInvestigateBlock: Remove dependency on SpecialBlock

This is solved by the same patch as T264303. Nothing additional to review or test for this task.

ARamirez_WMF changed the subtype of this task from "Bug Report" to "Deadline".Oct 8 2020, 10:12 PM
ARamirez_WMF set Due Date to Oct 20 2020, 4:00 AM.

Change 632906 merged by jenkins-bot:
[mediawiki/extensions/CheckUser@master] SpecialInvestigateBlock: Remove dependency on SpecialBlock

I can no longer reproduce this bug.

It is possible to use Special:InvestigateBlock to block your own user. There are no errors in the logs.

Test Environment: Local vagrant MediaWiki 1.36.0-alpha (8e68310).