Page MenuHomePhabricator

User subpages throw an error in 1.39 when Social Profile is active
Open, Stalled, Needs TriagePublic

Description

I'm encountering an erorr when using Social Profile on MW 1.39. I'm using the most recent master branch, and when Social Profile is enabled, visiting a user subpage, such as User:Original Authority/sandbox, I'm thrown this error: Error: Call to a member function getName() on bool. I'm not sure if this is an issue with the extension, or my install, but I can't think of anything on my install that would be causing this.

Event Timeline

Please provide more details, including:

  • the precise git commit hash of the SocialProfile extension
  • the full backtrace containing line numbers
  • the viewing user's login state

I tried reproducing this locally (using version d534c7c6ae54006d29c3808c9b3dd22c1f8acca7 of SocialProfile) and I was unable to trigger the error. Furthermore, logging in as the relevan user and changing my user page type from social profile -> wiki page or vice versa had no impact.

However, I do recall a bug like this and also fixing it...I think it was related to the actor support, and actor support in social tools is turning three years old in January '23 (!).

Interestingly, I just downloaded that version of the extension that you linked above and I get the same error.

  • Git hash; not sure how to get that, but I just downloaded the version you linked above and also tried the master branch from Github and also got the same result.
  • Happens when logged in or out.

The backtrace:

Original exception: [8d998a0ea79c440b7905c0b1] /wiki/User:Original_Authority/sandbox Error: Call to a member function getName() on bool
Backtrace:
from /var/www/html/mediawiki/extensions/SocialProfile/UserProfile/includes/UserProfile.php(85)
#0 /var/www/html/mediawiki/extensions/SocialProfile/UserProfile/includes/UserProfileHooks.php(118): UserProfile->__construct()
#1 /var/www/html/mediawiki/includes/HookContainer/HookContainer.php(338): UserProfileHooks::onArticleFromTitle()
#2 /var/www/html/mediawiki/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook()
#3 /var/www/html/mediawiki/includes/HookContainer/HookRunner.php(739): MediaWiki\HookContainer\HookContainer->run()
#4 /var/www/html/mediawiki/includes/page/Article.php(176): MediaWiki\HookContainer\HookRunner->onArticleFromTitle()
#5 /var/www/html/mediawiki/includes/page/Article.php(202): Article::newFromTitle()
#6 /var/www/html/mediawiki/includes/MediaWiki.php(432): Article::newFromWikiPage()
#7 /var/www/html/mediawiki/includes/MediaWiki.php(320): MediaWiki->initializeArticle()
#8 /var/www/html/mediawiki/includes/MediaWiki.php(904): MediaWiki->performRequest()
#9 /var/www/html/mediawiki/includes/MediaWiki.php(562): MediaWiki->main()
#10 /var/www/html/mediawiki/index.php(50): MediaWiki->run()
#11 /var/www/html/mediawiki/index.php(46): wfIndexMain()
#12 {main}

Exception caught inside exception handler: [8d998a0ea79c440b7905c0b1] /wiki/User:Original_Authority/sandbox Error: Call to a member function getName() on bool
Backtrace:
from /var/www/html/mediawiki/extensions/SocialProfile/UserProfile/includes/UserProfile.php(85)
#0 /var/www/html/mediawiki/extensions/SocialProfile/UserProfile/includes/UserProfileHooks.php(118): UserProfile->__construct()
#1 /var/www/html/mediawiki/includes/HookContainer/HookContainer.php(338): UserProfileHooks::onArticleFromTitle()
#2 /var/www/html/mediawiki/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook()
#3 /var/www/html/mediawiki/includes/HookContainer/HookRunner.php(739): MediaWiki\HookContainer\HookContainer->run()
#4 /var/www/html/mediawiki/includes/page/Article.php(176): MediaWiki\HookContainer\HookRunner->onArticleFromTitle()
#5 /var/www/html/mediawiki/includes/page/Article.php(202): Article::newFromTitle()
#6 /var/www/html/mediawiki/includes/actions/ActionFactory.php(402): Article::newFromWikiPage()
#7 /var/www/html/mediawiki/includes/actions/ActionFactory.php(365): MediaWiki\Actions\ActionFactory->getArticle()
#8 /var/www/html/mediawiki/includes/actions/Action.php(112): MediaWiki\Actions\ActionFactory->getActionName()
#9 /var/www/html/mediawiki/extensions/CodeMirror/includes/Hooks.php(33): Action::getActionName()
#10 /var/www/html/mediawiki/extensions/CodeMirror/includes/Hooks.php(47): MediaWiki\Extension\CodeMirror\Hooks::isCodeMirrorOnPage()
#11 /var/www/html/mediawiki/includes/HookContainer/HookContainer.php(338): MediaWiki\Extension\CodeMirror\Hooks::onBeforePageDisplay()
#12 /var/www/html/mediawiki/includes/HookContainer/HookContainer.php(137): MediaWiki\HookContainer\HookContainer->callLegacyHook()
#13 /var/www/html/mediawiki/includes/HookContainer/HookRunner.php(945): MediaWiki\HookContainer\HookContainer->run()
#14 /var/www/html/mediawiki/includes/OutputPage.php(2871): MediaWiki\HookContainer\HookRunner->onBeforePageDisplay()
#15 /var/www/html/mediawiki/includes/exception/MWExceptionRenderer.php(183): OutputPage->output()
#16 /var/www/html/mediawiki/includes/exception/MWExceptionRenderer.php(102): MWExceptionRenderer::reportHTML()
#17 /var/www/html/mediawiki/includes/exception/MWExceptionHandler.php(131): MWExceptionRenderer::output()
#18 /var/www/html/mediawiki/includes/exception/MWExceptionHandler.php(248): MWExceptionHandler::report()
#19 /var/www/html/mediawiki/includes/MediaWiki.php(584): MWExceptionHandler::handleException()
#20 /var/www/html/mediawiki/index.php(50): MediaWiki->run()
#21 /var/www/html/mediawiki/index.php(46): wfIndexMain()
#22 {main}
  • Git hash; not sure how to get that, but I just downloaded the version you linked above and also tried the master branch from Github and also got the same result.

You should be able to find the git hashes for things downloaded using git on Special:Version, and of course you can always run git log in the appropriate directory to see that (and a lot of other info).

The backtrace:

Thanks for this! I'm still quite baffled about the issue, because in the relevant code paths, we do check as the very first thing, "is the page we're dealing with NOT a subpage?" (by calling Title#isSubpage). Custom processing by SocialProfile should only happen for non-subpage pages in NS_USER and NS_USER_PROFILE. However, a fellow developer pointed out to me that the isSubpage check can fail if $wgNamespacesWithSubpages is set to false for the NS_USER namespace. Would that happen to be the case with your wiki?

Additionally, if you're able to pastebin your wiki's LocalSettings.php (with all the private passwords, URLs, access tokens and the like redacted, of course), that could potentially be of use in debugging this issue.

You should be able to find the git hashes for things downloaded using git on Special:Version, and of course you can always run git log in the appropriate directory to see that (and a lot of other info).

From S:V, the version appears to be 1.14 (225355c).

Thanks for this! I'm still quite baffled about the issue, because in the relevant code paths, we do check as the very first thing, "is the page we're dealing with NOT a subpage?" (by calling Title#isSubpage). Custom processing by SocialProfile should only happen for non-subpage pages in NS_USER and NS_USER_PROFILE. However, a fellow developer pointed out to me that the isSubpage check can fail if $wgNamespacesWithSubpages is set to false for the NS_USER namespace. Would that happen to be the case with your wiki?

Additionally, if you're able to pastebin your wiki's LocalSettings.php (with all the private passwords, URLs, access tokens and the like redacted, of course), that could potentially be of use in debugging this issue.

Can confirm that $wgNamespacesWithSubpages is set to the default which is true for NS_USER namespace. Additionally, the LS.php for this particular wiki is here, in JSON for easy reading :)

ashley changed the task status from Open to Stalled.May 19 2023, 12:22 AM

Seems I forgot to post a comment here...but I did take a look at the pastebin when it was active and found nothing odd in there either, but I've not had any luck in reproducing this bug locally, so setting status to stalled for the time being.