Page MenuHomePhabricator

If primary mentor is the only other available mentor, then backup mentor logic will fatal
Closed, ResolvedPublic

Description

From my local wiki:

MediaWiki internal error.

Original exception: [ef2ea9d8563a903b266716a1] /w/index.php?title=Special:Homepage&source=personaltoolslink&namespace=-1 Error: Call to a member function getMentorUser() on null
Backtrace:
from /home/urbanecm/unsynced/gerrit/mediawiki/extensions/GrowthExperiments/includes/HelpPanelHooks.php(233)
#0 /home/urbanecm/unsynced/gerrit/mediawiki/extensions/GrowthExperiments/includes/HelpPanelHooks.php(148): GrowthExperiments\HelpPanelHooks->getMentorData(GrowthExperiments\Config\GrowthExperimentsMultiConfig, User, RequestContext)
#1 /home/urbanecm/unsynced/gerrit/mediawiki/core/includes/HookContainer/HookContainer.php(160): GrowthExperiments\HelpPanelHooks->onBeforePageDisplay(OutputPage, SkinVector)
#2 /home/urbanecm/unsynced/gerrit/mediawiki/core/includes/HookContainer/HookRunner.php(938): MediaWiki\HookContainer\HookContainer->run(string, array, array)
#3 /home/urbanecm/unsynced/gerrit/mediawiki/core/includes/OutputPage.php(2695): MediaWiki\HookContainer\HookRunner->onBeforePageDisplay(OutputPage, SkinVector)
#4 /home/urbanecm/unsynced/gerrit/mediawiki/core/includes/MediaWiki.php(917): OutputPage->output(boolean)
#5 /home/urbanecm/unsynced/gerrit/mediawiki/core/includes/MediaWiki.php(930): MediaWiki::{closure}()
#6 /home/urbanecm/unsynced/gerrit/mediawiki/core/includes/MediaWiki.php(563): MediaWiki->main()
#7 /home/urbanecm/unsynced/gerrit/mediawiki/core/index.php(53): MediaWiki->run()
#8 /home/urbanecm/unsynced/gerrit/mediawiki/core/index.php(46): wfIndexMain()
#9 {main}

Exception caught inside exception handler: [ef2ea9d8563a903b266716a1] /w/index.php?title=Special:Homepage&source=personaltoolslink&namespace=-1 Error: Call to a member function getMentorUser() on null
Backtrace:
from /home/urbanecm/unsynced/gerrit/mediawiki/extensions/GrowthExperiments/includes/HelpPanelHooks.php(233)
#0 /home/urbanecm/unsynced/gerrit/mediawiki/extensions/GrowthExperiments/includes/HelpPanelHooks.php(148): GrowthExperiments\HelpPanelHooks->getMentorData(GrowthExperiments\Config\GrowthExperimentsMultiConfig, User, RequestContext)
#1 /home/urbanecm/unsynced/gerrit/mediawiki/core/includes/HookContainer/HookContainer.php(160): GrowthExperiments\HelpPanelHooks->onBeforePageDisplay(OutputPage, SkinVector)
#2 /home/urbanecm/unsynced/gerrit/mediawiki/core/includes/HookContainer/HookRunner.php(938): MediaWiki\HookContainer\HookContainer->run(string, array, array)
#3 /home/urbanecm/unsynced/gerrit/mediawiki/core/includes/OutputPage.php(2695): MediaWiki\HookContainer\HookRunner->onBeforePageDisplay(OutputPage, SkinVector)
#4 /home/urbanecm/unsynced/gerrit/mediawiki/core/includes/exception/MWExceptionRenderer.php(158): OutputPage->output()
#5 /home/urbanecm/unsynced/gerrit/mediawiki/core/includes/exception/MWExceptionRenderer.php(77): MWExceptionRenderer::reportHTML(Error)
#6 /home/urbanecm/unsynced/gerrit/mediawiki/core/includes/exception/MWExceptionHandler.php(107): MWExceptionRenderer::output(Error, integer)
#7 /home/urbanecm/unsynced/gerrit/mediawiki/core/includes/exception/MWExceptionHandler.php(202): MWExceptionHandler::report(Error)
#8 /home/urbanecm/unsynced/gerrit/mediawiki/core/includes/MediaWiki.php(585): MWExceptionHandler::handleException(Error, string)
#9 /home/urbanecm/unsynced/gerrit/mediawiki/core/index.php(53): MediaWiki->run()
#10 /home/urbanecm/unsynced/gerrit/mediawiki/core/index.php(46): wfIndexMain()
#11 {main}

My list of mentors:

* [[User:Mentor]]
* [[User:Martin Urbanec]]

Steps to reproduce:

  1. Login as my personal user, ensure I have User:Mentor as my primary mentor
  2. Login as User:Mentor and set them to away via the mentor dashboard
  3. Login as my personal user
  4. Any page load will fatal

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

FTR, adding User:Other_mentor to the list of mentors fixed it.

Change 752180 had a related patch set uploaded (by Urbanecm; author: Urbanecm):

[mediawiki/extensions/GrowthExperiments@master] HelpPanelHooks::getMentorData: Do not fatal if $effectiveMentor is null

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

Change 752180 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] HelpPanelHooks::getMentorData: Do not fatal if $effectiveMentor is null

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

Etonkovidova subscribed.

Checked in cswiki betalabs - works as expected

  • the only mentor on wiki would set its status as Away
  • for a mentee the Homepage is displayed without Mentorship module

Screen Shot 2022-01-24 at 5.07.29 PM.png (789×1 px, 147 KB)

  • "Ask your mentor" will change to "Ask Help desk"