Page MenuHomePhabricator

Too few arguments to function ObjectCache::getInstance(), 0 passed in "HitCounters.body.php" on line 39 and exactly 1 expected
Closed, ResolvedPublic

Description

Setup

  • MediaWiki REL1_35
  • HitCounters REL1_35
  • PHP 7.4.3
  • MariaDB 10.3.25

Issue

[7fc2700d879184f2101dd72f] /seite/Benutzer:Admin/Spielwiese ArgumentCountError from line 78 of /../w/includes/objectcache/ObjectCache.php: Too few arguments to function ObjectCache::getInstance(), 0 passed in /../w/extensions/HitCounters/includes/HitCounters.body.php on line 39 and exactly 1 expected

Rolling back to REL1_34. Issue appears to be caused by this commit trying to fix T266502

Backtrace

#0 /../w/extensions/HitCounters/includes/HitCounters.body.php(39): ObjectCache::getInstance()
#1 /../w/extensions/HitCounters/includes/HitCounters.hooks.php(151): HitCounters\HitCounters::getCount()
#2 /../w/includes/HookContainer/HookContainer.php(321): HitCounters\Hooks::onSkinTemplateOutputPageBeforeExec()
#3 /../w/includes/HookContainer/HookContainer.php(132): MediaWiki\HookContainer\HookContainer->callLegacyHook()
#4 /../w/includes/HookContainer/HookRunner.php(3604): MediaWiki\HookContainer\HookContainer->run()
#5 /../w/includes/skins/SkinTemplate.php(399): MediaWiki\HookContainer\HookRunner->onSkinTemplateOutputPageBeforeExec()
#6 /../w/includes/skins/SkinTemplate.php(127): SkinTemplate->prepareQuickTemplate()
#7 /../w/includes/skins/SkinTemplate.php(144): SkinTemplate->generateHTML()
#8 /../w/includes/OutputPage.php(2615): SkinTemplate->outputPage()
#9 /../w/includes/MediaWiki.php(947): OutputPage->output()
#10 /../w/includes/MediaWiki.php(960): MediaWiki->{closure}()
#11 /../w/includes/MediaWiki.php(543): MediaWiki->main()
#12 /../w/index.php(53): MediaWiki->run()
#13 /../w/index.php(46): wfIndexMain()
#14 {main}

Event Timeline

@Umherirrender Since you happen to have authored the commit creating the issue described. Do you happen to know a fix for this issue described here? "In the wild" it was suggested to reintroduce this commit to fix. Not sure though.

Change 672774 had a related patch set uploaded (by Umherirrender; owner: Umherirrender):
[mediawiki/extensions/HitCounters@master] Fix replacement for wfGetMainCache

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

Umherirrender claimed this task.
Umherirrender triaged this task as High priority.

The broken patch is not part of REL1_35, it should not be broken when using the REL1_35 branch of the extension as mention in the task description. Only master is broken.

https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/extensions/HitCounters/+/refs/heads/REL1_35/includes/HitCounters.body.php

Change 672774 merged by Umherirrender:
[mediawiki/extensions/HitCounters@master] Fix replacement for wfGetMainCache

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

@Umherirrender Thanks for looking into this and fixing the issue. Very much appreciated! I could have sworn that the issue appeared with REL1_35 however now checking out this branch shows that there is not. I was dealing with several extensions that day which all had issues of their own: Apparently I got confused on the way.