Page MenuHomePhabricator

TypeError from line 34 of src/CompareService.php: Argument 1 passed to CompareService::getTotalEditsFromIp() must be of the type string, null given
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

  1. Install MediaWiki using the Docker development environment.
  2. Install CheckUser and enable Special:Investigate
  3. Create another user and make an edit with that user
  4. Perform an Investigation with that user and go to the "Compare" tab

Actual Results:

[4e91b5b5deed23329228d302] /index.php?title=Special:Investigate/Compare&token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1OTA1NDUyMDgsImRhdGEiOiIzcTk1Qjg1ZGdrMHBYT3VSN3pkVGhFN012N0JwdDFSODEwMytFWGZwMENpNFdycmtubkZPdzg4PSJ9.W-FojMyeggG-7Kb56l-axzWav784qZNWodccoFWlpxY TypeError from line 34 of /var/www/html/extensions/CheckUser/src/CompareService.php: Argument 1 passed to MediaWiki\CheckUser\CompareService::getTotalEditsFromIp() must be of the type string, null given, called in /var/www/html/extensions/CheckUser/src/ComparePager.php on line 171

Backtrace:

#0 /var/www/html/extensions/CheckUser/src/ComparePager.php(171): MediaWiki\CheckUser\CompareService->getTotalEditsFromIp(NULL)
#1 /var/www/html/includes/pager/TablePager.php(195): MediaWiki\CheckUser\ComparePager->formatValue(string, NULL)
#2 /var/www/html/includes/pager/IndexPager.php(585): TablePager->formatRow(stdClass)
#3 /var/www/html/includes/pager/TablePager.php(106): IndexPager->getBody()
#4 /var/www/html/extensions/CheckUser/src/SpecialInvestigate.php(265): TablePager->getFullOutput()
#5 /var/www/html/extensions/CheckUser/src/SpecialInvestigate.php(94): MediaWiki\CheckUser\SpecialInvestigate->addTabContent(string)
#6 /var/www/html/includes/specialpage/SpecialPage.php(582): MediaWiki\CheckUser\SpecialInvestigate->execute(string)
#7 /var/www/html/includes/specialpage/SpecialPageFactory.php(623): SpecialPage->run(string)
#8 /var/www/html/includes/MediaWiki.php(299): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#9 /var/www/html/includes/MediaWiki.php(978): MediaWiki->performRequest()
#10 /var/www/html/includes/MediaWiki.php(535): MediaWiki->main()
#11 /var/www/html/index.php(47): MediaWiki->run()
#12 {main}

Expected Results:
The "Compare" results.

Technical Details

Event Timeline

dbarratt created this task.May 26 2020, 2:15 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 26 2020, 2:15 AM
dbarratt updated the task description. (Show Details)May 26 2020, 2:17 AM
dbarratt updated the task description. (Show Details)May 26 2020, 2:22 AM

Change 598563 had a related patch set uploaded (by Dbarratt; owner: Dbarratt):
[mediawiki/extensions/CheckUser@master] Alias the column names for the result

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

I don't understand why this didn't break before now, but the patch fixes the problem.

Tchanders updated the task description. (Show Details)May 26 2020, 1:12 PM

It looks like this is specific to the Docker environment - see also T253235. (I can't reproduce it on my local setup, which doesn't use Docker.) Have updated the description accordingly.

Change 598563 merged by jenkins-bot:
[mediawiki/extensions/CheckUser@master] Alias the column names for the result

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

It looks like this is specific to the Docker environment - see also T253235. (I can't reproduce it on my local setup, which doesn't use Docker.) Have updated the description accordingly.

Based on T253235 I assume it's specific to SQLite rather than MediaWiki-Docker, but potato potato.

Tchanders assigned this task to dbarratt.Jun 2 2020, 3:27 PM
dbarratt closed this task as Resolved.Jun 24 2020, 3:49 PM