Page MenuHomePhabricator

Undefined index: query submitting investigation from Special:Investigate/Preliminary_Check [4hours]
Closed, ResolvedPublicApr 1 2020

Description

What is the problem?

If I try to start an investigation from the URL Special:Investigate/Preliminary_Check (or Special:Investigate/anything), I get:

[error] [d0fd3cb1cb92fa8ab75da441] /wiki/Special:Investigate/Preliminary_Check   ErrorException from line 485 of /vagrant/mediawiki/extensions/CheckUser/src/SpecialInvestigate.php: PHP Notice: Undefined index: query
#0 /vagrant/mediawiki/extensions/CheckUser/src/SpecialInvestigate.php(485): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /vagrant/mediawiki/extensions/CheckUser/src/SpecialInvestigate.php(438): MediaWiki\CheckUser\SpecialInvestigate->getRedirectUrl(string)
#2 /vagrant/mediawiki/includes/htmlform/HTMLForm.php(694): MediaWiki\CheckUser\SpecialInvestigate->onSubmit(array, OOUIHTMLForm)
#3 /vagrant/mediawiki/includes/htmlform/HTMLForm.php(586): HTMLForm->trySubmit()
#4 /vagrant/mediawiki/includes/htmlform/HTMLForm.php(601): HTMLForm->tryAuthorizedSubmit()
#5 /vagrant/mediawiki/includes/specialpage/FormSpecialPage.php(187): HTMLForm->show()
#6 /vagrant/mediawiki/extensions/CheckUser/src/SpecialInvestigate.php(71): FormSpecialPage->execute(string)
#7 /vagrant/mediawiki/includes/specialpage/SpecialPage.php(575): MediaWiki\CheckUser\SpecialInvestigate->execute(string)
#8 /vagrant/mediawiki/includes/specialpage/SpecialPageFactory.php(621): SpecialPage->run(string)
#9 /vagrant/mediawiki/includes/MediaWiki.php(299): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#10 /vagrant/mediawiki/includes/MediaWiki.php(972): MediaWiki->performRequest()
#11 /vagrant/mediawiki/includes/MediaWiki.php(535): MediaWiki->main()
#12 /vagrant/mediawiki/index.php(47): MediaWiki->run()
#13 /var/www/w/index.php(5): require(string)
#14 {main}

I don't know how likely users are to do this in reality.

But, I have done this a couple of times when my session has expired (e.g. I had to close and reopen my browser). I have tried to return to the old investigation URL with the token (e.g. ?title=Special:Investigate/Compare&token=$token) and been redirected to the Special:Investigate form but with the old URL. When I then try to submit the investigation again, I get the exception.

Steps to reproduce problem
  1. Go to, for example, Special:Investigate/Compare
  2. Enter any valid target
  3. Submit

Expected behavior: Investigation starts as usual. You land on the Preliminary Check page.
Observed behavior: Exception.

Environment

Wiki(s): MediaWiki 1.35.0-alpha (d3ab01b); CheckUser 2.5 (87381f8) 07:53, 13 March 2020 (local vagrant)

Event Timeline

I can't replicate this issue. I assume wfParseURL() isn't returning the proper result...

Niharika moved this task from Untriaged to Triage/To be Estimated on the Anti-Harassment board.
ARamirez_WMF renamed this task from Undefined index: query submitting investigation from Special:Investigate/Preliminary_Check to Undefined index: query submitting investigation from Special:Investigate/Preliminary_Check [4hours].Mar 18 2020, 4:58 PM
Niharika changed the subtype of this task from "Bug Report" to "Deadline".Mar 25 2020, 10:21 PM
Niharika set Due Date to Apr 1 2020, 7:00 AM.

Change 585251 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/extensions/CheckUser@master] SpecialInvestigate: check for 'query' index in getRedirectUrl

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

This is still happening, but it's not readily apparent because the undefined index notice is occurs before the redirect. We just need to check for the 'query' index in the URL parts, which isn't present when the URL is Special:Investigate/Compare or similar.

This is still happening, but it's not readily apparent because the undefined index notice is occurs before the redirect. We just need to check for the 'query' index in the URL parts, which isn't present when the URL is Special:Investigate/Compare or similar.

Were you able to replicate the issue?

Oh I see, the keys are not guaranteed, well learned something new today. :)

Change 585251 merged by jenkins-bot:
[mediawiki/extensions/CheckUser@master] SpecialInvestigate: check for 'query' index in getRedirectUrl

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

I can no longer reproduce the issue on my local vagrant (MediaWiki 1.35.0-alpha (7ab9daa); CheckUser 2.5 (c1792b7) 06:28, 3 April 2020).

I can go to /w/index.php?title=Special:Investigate/Compare, submit an investigation and be taken directly to the Compare tab, which might be quite useful actually.