Page MenuHomePhabricator

The given PageIdentity Special:QuizGameHome does not represent a proper page
Open, Needs TriagePublicBUG REPORT

Description

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

  • Install the newest version of QuizGame from either Git or ExtensionDistributor
  • Follows the usual installation steps and updates the database
  • Go to Special:QuizGameHome and create a quiz question with at least 2 answers.

What happens?:
It redirects to a blank page with the exception code and the backtraces if $wgShowExceptionDetails = true;

What should have happened instead?:
Showing the newly created question and playing with it

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):
MediaWiki 1.42.1
PHP 8.2.12 (apache2handler)
ICU 71.1
MariaDB 10.4.32-MariaDB
Lua 5.1.5
Pygments 2.17.2
Other information (browser name/version, screenshots, etc.):
Back traces from Citizen skin as follow:

Backtrace:
from D:\XAMPP\htdocs\includes\page\WikiPageFactory.php(57)
#0 D:\XAMPP\htdocs\extensions\VisualEditor\includes\Hooks.php(624): MediaWiki\Page\WikiPageFactory->newFromTitle(MediaWiki\Title\Title)
#1 D:\XAMPP\htdocs\includes\HookContainer\HookContainer.php(159): MediaWiki\Extension\VisualEditor\Hooks->onSkinTemplateNavigation__Universal(MediaWiki\Skins\Citizen\SkinCitizen, array)
#2 D:\XAMPP\htdocs\includes\HookContainer\HookRunner.php(3581): MediaWiki\HookContainer\HookContainer->run(string, array, array)
#3 D:\XAMPP\htdocs\includes\skins\SkinTemplate.php(964): MediaWiki\HookContainer\HookRunner->onSkinTemplateNavigation__Universal(MediaWiki\Skins\Citizen\SkinCitizen, array)
#4 D:\XAMPP\htdocs\skins\Citizen\includes\SkinCitizen.php(71): SkinTemplate->runOnSkinTemplateNavigationHooks(MediaWiki\Skins\Citizen\SkinCitizen, array)
#5 D:\XAMPP\htdocs\includes\skins\SkinTemplate.php(1357): MediaWiki\Skins\Citizen\SkinCitizen->runOnSkinTemplateNavigationHooks(MediaWiki\Skins\Citizen\SkinCitizen, array)
#6 D:\XAMPP\htdocs\includes\skins\SkinTemplate.php(607): SkinTemplate->buildContentNavigationUrlsInternal()
#7 D:\XAMPP\htdocs\includes\skins\SkinTemplate.php(183): SkinTemplate->getPortletsTemplateData()
#8 D:\XAMPP\htdocs\includes\skins\SkinMustache.php(139): SkinTemplate->getTemplateData()
#9 D:\XAMPP\htdocs\skins\Citizen\includes\SkinCitizen.php(79): SkinMustache->getTemplateData()
#10 D:\XAMPP\htdocs\includes\skins\SkinMustache.php(92): MediaWiki\Skins\Citizen\SkinCitizen->getTemplateData()
#11 D:\XAMPP\htdocs\includes\skins\SkinTemplate.php(176): SkinMustache->generateHTML()
#12 D:\XAMPP\htdocs\includes\Output\OutputPage.php(3004): SkinTemplate->outputPage()
#13 D:\XAMPP\htdocs\includes\exception\MWExceptionRenderer.php(189): MediaWiki\Output\OutputPage->output()
#14 D:\XAMPP\htdocs\includes\exception\MWExceptionRenderer.php(106): MWExceptionRenderer::reportHTML(MediaWiki\Page\PageAssertionException)
#15 D:\XAMPP\htdocs\includes\exception\MWExceptionHandler.php(133): MWExceptionRenderer::output(MediaWiki\Page\PageAssertionException, integer)
#16 D:\XAMPP\htdocs\includes\exception\MWExceptionHandler.php(237): MWExceptionHandler::report(MediaWiki\Page\PageAssertionException)
#17 D:\XAMPP\htdocs\includes\MediaWikiEntryPoint.php(221): MWExceptionHandler::handleException(MediaWiki\Page\PageAssertionException, string)
#18 D:\XAMPP\htdocs\includes\actions\ActionEntryPoint.php(82): MediaWiki\MediaWikiEntryPoint->handleTopLevelError(MediaWiki\Page\PageAssert

Event Timeline

ashley added subscribers: matmarex, ashley.

First off, a brief disclaimer: post-1.39 versions of MW are untested and, in this sense, "unsupported"; but of course 1.39 will go EOL at some point, and then social tools will target the next LTS (more details on MW.org @ mw:Social tools/MediaWiki compatibility). So in a way, you're charting uncharted waters here - thank you for your bravery, it's appreciated! :)

Other than the bug manifesting itself on QuizGame's main special page, I'm not seeing anything else that'd indicate that this is strictly speaking a bug in QuizGame. Rather, looking at the backtrace, it looks like it's a VisualEditor one instead. VE's hooks class' onSkinTemplateNavigation__Universal has this line:

$isRemote = !$wikiPageFactory->newFromTitle( $title )->isLocal();

This, somewhat incorrectly, seems to assume that the WikiPageFactory#newFromTitle will always return something that represents "a proper page" (however "proper" may be defined there...). Now, to be fair to VE devs, they're hardly the only ones doing something like this; judging by a quick codesearch, almost all callers assume that WikiPageFactory#newFromTitle will not exception out. The only one that seems to bother implementing a try-catch loop is includes/installer/Installer.php. Weird.

As a VisualEditor developer, one could argue that it's very unusual to see content action tabs on a special page. I'm inclined to agree, but to also note that they actually make perfect sense in the context of QuizGame and related extensions, namely PictureGame and PollNY: two of these three (PollNY is the odd one out, sorta; it does use the new Poll: namespace for its new content, but that's somewhat incomplete and you should always be modifying PollNY data via the Special:*Poll pages like Special:UpdatePoll; basically PollNY currently suffers from the same stuff that FanBoxes did earlier this year, prior to a84d8f4025f203e5bd473dda9e133c79dce511ab) implement content that exists and is editable by some users (e.g. admins), but such content does not have any corresponding wiki page, they only exist in the underlying DB tables and thus the relevant special page(s) is the main UI for altering said data.

cc'ing @matmarex for input on this.

First off, a brief disclaimer: post-1.39 versions of MW are untested and, in this sense, "unsupported"; but of course 1.39 will go EOL at some point, and then social tools will target the next LTS (more details on MW.org @ mw:Social tools/MediaWiki compatibility). So in a way, you're charting uncharted waters here - thank you for your bravery, it's appreciated! :)

Thanks for the kind words! As far as my knowledge it will be released for public consumption in December this year, I'm looking forward to that and also looking to connect more with you regarding things like these.

I'm not seeing anything else indicating that this is strictly a bug in QuizGame. Rather, looking at the backtrace, it seems like it's a VisualEditor one instead.

The issues disappear from my view in the same local XAMPP test instance when I disable the VE + dependencies. So far, it's quite "normal" for me.

Judging by a quick codesearch, almost all callers assume that WikiPageFactory#newFromTitle will not exception out.

That reminds me of what happened to THERAC-25 in the 80s...

The VisualEditor code using isLocal() (note that there's one more call site) just wants to display some special messages for files automatically copied from Commons, global user pages automatically copied from Meta-Wiki, etc. If you can rewrite that code so that this functionality still works, while not crashing when combined with Social Tools, I'm sure that would be a welcome patch.