Topic on Extension talk:HitCounters

Main_Page Error: Call to undefined function HitCounters\wfMemcKey()

7
Noloader (talkcontribs)

Hi Everyone,

We run Mediawiki on a Ubuntu 20.04 server. We just upgraded from Mediawiki 1.36 to 1.36.1. Composer updated vendor stuff, and maintenance/update.php completed successfully. HitCounters is using the REL1_36 branch and up to date.

After restarting the Apache webserver we are seeing the following.

Internal error

[YNS8Yk0uwEj5gvQDE6jINAAAABk] /wiki/Main_Page Error: Call to undefined function HitCounters\wfMemcKey()

Backtrace:

from /var/www/html/w/extensions/HitCounters/includes/HitCounters.body.php(37)
#0 /var/www/html/w/extensions/HitCounters/includes/HitCounters.hooks.php(153): HitCounters\HitCounters::getCount()
#1 /var/www/html/w/includes/HookContainer/HookContainer.php(338): HitCounters\Hooks::onSkinTemplateOutputPageBeforeExec()
#2 /var/www/html/w/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook()
#3 /var/www/html/w/includes/HookContainer/HookRunner.php(3612): MediaWiki\HookContainer\HookContainer->run()
#4 /var/www/html/w/includes/skins/SkinTemplate.php(403): MediaWiki\HookContainer\HookRunner->onSkinTemplateOutputPageBeforeExec()
#5 /var/www/html/w/includes/skins/SkinTemplate.php(129): SkinTemplate->prepareQuickTemplate()
#6 /var/www/html/w/includes/skins/SkinTemplate.php(146): SkinTemplate->generateHTML()
#7 /var/www/html/w/includes/OutputPage.php(2634): SkinTemplate->outputPage()
#8 /var/www/html/w/includes/MediaWiki.php(927): OutputPage->output()
#9 /var/www/html/w/includes/MediaWiki.php(940): MediaWiki::{closure}()
#10 /var/www/html/w/includes/MediaWiki.php(546): MediaWiki->main()
#11 /var/www/html/w/index.php(53): MediaWiki->run()
#12 /var/www/html/w/index.php(46): wfIndexMain()
#13 {main}


Noloader (talk) 17:17, 24 June 2021 (UTC)

WikiForMen (talkcontribs)

Seems you have to update your HitCounters extension! ;-) --WikiForMen (talk) 04:46, 25 June 2021 (UTC)

Noloader (talkcontribs)

Thanks @WikiForMen. I re-enabled HitCounters today and it worked as expected.

I'm not sure what went sideways after the upgrade.

Sorry about the extra noise.

Noloader (talk) 17:04, 25 June 2021 (UTC)

WikiForMen (talkcontribs)

The function wfMemcKey() is not longer defined in Mediawiki 1.36. That's all. :-) Good luck! --WikiForMen (talk) 19:21, 25 June 2021 (UTC)

Bluedreamer1 (talkcontribs)

Do you happen to know what the replacement is. I have the same issue with Semantic Glossary (master branch) and 1.36.

TIA

[YN8cHpdWKUJoWuUH6sbaowAAAIs] /Equipment:Laser_Pistol Error: Call to undefined function SG\Cache\wfMemcKey()

Backtrace:

from /home/mediawiki/wiki/extensions/SemanticGlossary/src/Cache/GlossaryCache.php(56) #0 /home/mediawiki/wiki/extensions/SemanticGlossary/src/Cache/ElementsCacheBuilder.php(78): SG\Cache\GlossaryCache->getKeyForSubject()

#1 /home/mediawiki/wiki/extensions/SemanticGlossary/src/LingoBackendAdapter.php(59): SG\Cache\ElementsCacheBuilder->getElements()

#2 /home/mediawiki/wiki/extensions/Lingo/src/LingoParser.php(186): SG\LingoBackendAdapter->next()

#3 /home/mediawiki/wiki/extensions/Lingo/src/LingoParser.php(159): Lingo\LingoParser->buildLingo()

#4 /home/mediawiki/wiki/extensions/Lingo/src/LingoParser.php(217): Lingo\LingoParser->getLingoTree()

#5 /home/mediawiki/wiki/extensions/Lingo/src/LingoParser.php(83): Lingo\LingoParser->realParse()

#6 /home/mediawiki/wiki/extensions/Lingo/src/Lingo.php(53): Lingo\LingoParser->parse()


And I love it when I find comments like this in the relevant code :-)

  public function getKeyForSubject( DIWikiPage $subject ) {

     // FIXME Remove wfMemcKey dep.

     return wfMemcKey( 'ext', 'semanticglossary', $subject->getSerialization() );

  }

  /**

   * @since 1.1

   *

   * @return string

   */

  public function getKeyForLingo() {

     // FIXME Remove wfMemcKey dep.

     // This key should come from something like LingoCache::getKey()

     return wfMemcKey( 'ext', 'lingo', 'lingotree' );

  }

Noloader (talkcontribs)
Bluedreamer1 (talkcontribs)

Thanks. I realized this wasn't the general help after I posted, but I more interested in the if there is a one-for-one replacement of wfMemcKey() then I can just fix the code.I guess I could just checkout HitCounters codebase and look at what they.

Reply to "Main_Page Error: Call to undefined function HitCounters\wfMemcKey()"