Page MenuHomePhabricator

Exception when the title is malformed
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Install TitleIcon and SemanticMediaWiki
  • Define the property Title Icon as a text with [[Has type::Text]] on Property:Title Icon.
  • Add {{#set:Title Icon=MyTit{{!}}e}} on some page, save.

What happens?:

  • The page shows:
Original exception: [4eca641317ec5555ea6cf613] /mediawiki/master/index.php?title=Main_Page Error: Call to a member function getPrefixedText() on null
Backtrace:
from /srv/www/mediawiki/master/extensions/TitleIcon/src/Icon.php(65)
#0 /var/www/mediawiki/master/extensions/TitleIcon/src/IconManager.php(189): MediaWiki\Extension\TitleIcon\Icon->__construct()
#1 /var/www/mediawiki/master/extensions/TitleIcon/src/MainHookHandler.php(78): MediaWiki\Extension\TitleIcon\IconManager->getIcons()
#2 /var/www/mediawiki/master/includes/HookContainer/HookContainer.php(160): MediaWiki\Extension\TitleIcon\MainHookHandler->onBeforePageDisplay()
#3 /var/www/mediawiki/master/includes/HookContainer/HookRunner.php(949): MediaWiki\HookContainer\HookContainer->run()
#4 /srv/www/mediawiki/master/includes/OutputPage.php(2887): MediaWiki\HookContainer\HookRunner->onBeforePageDisplay()
#5 /var/www/mediawiki/master/includes/MediaWiki.php(922): OutputPage->output()
#6 /var/www/mediawiki/master/includes/MediaWiki.php(562): MediaWiki->main()
#7 /var/www/mediawiki/master/index.php(51): MediaWiki->run()
#8 /var/www/mediawiki/master/index.php(47): wfIndexMain()
#9 {main}

What should have happened instead?:

The page should be displayed. Optionally the problem could be added in some automatic category, but this is out of scope here.

Software version (skip for WMF-hosted wikis like Wikipedia):

  • MediaWiki 1.40.0-alpha (5250bab9370)
  • SemanticMediaWiki 4.0.2 (0d6b0cb9e)
  • TitleIcon 6.0 (556fe92)

Other information (browser name/version, screenshots, etc.):

Event Timeline

And here is the corresponding patch

Change 882186 had a related patch set uploaded (by Seb35; author: Seb35):

[mediawiki/extensions/TitleIcon@master] Avoid an exception when the title is malformed

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

Seb35 triaged this task as Low priority.Jan 21 2023, 7:41 PM

Change 882186 merged by jenkins-bot:

[mediawiki/extensions/TitleIcon@master] Avoid an exception when the title is malformed

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

This bug is fixed from version 1.40 (branch REL1_40).

Change 932277 had a related patch set uploaded (by Cicalese; author: Seb35):

[mediawiki/extensions/TitleIcon@REL1_39] Avoid an exception when the title is malformed

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

Change 932277 merged by jenkins-bot:

[mediawiki/extensions/TitleIcon@REL1_39] Avoid an exception when the title is malformed

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