Page MenuHomePhabricator

DisplayTitle extension prevents Template or Module page save/purge with Scribunto
Closed, ResolvedPublicBUG REPORT

Description

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

I'm running MediaWiki 1.39.4 on Ubunto within the WIndows Subsystem for Linux (WLS) on my laptop. Infro from Special:Version

MediaWiki 	1.39.4
PHP 	        8.1.2-1ubuntu2.13 (apache2handler)
MariaDB 	10.6.12-MariaDB-0ubuntu0.22.04.1
ICU 	        70.1
LuaSandbox 	4.0.2
Lua 	        5.1.5
Pygments 	2.11.2

In LocalSettings.php

wfLoadExtension( 'DisplayTitle' );
$wgDisplayTitleHideSubtitle = false;
$wgRestrictDisplayTitle = false;`
wfLoadExtension( 'Scribunto' );

Page Main Page has no trouble being edited and saved.

Page Module:Test - cannot be saved or purged thereafter

p = {}

function p.show()
	return "Hello world"
end

Page Template:Test - cannot be saved or purged thereafter

{{#invoke:test|show}}

What happens?:

`[83855974ac201e2700285c50] /en.wikimergic.org/wiki/Template:Test Error: Class "DisplayTitleLuaLibrary" not found

Backtrace:

from /var/lib/mediawiki-1.39.4/extensions/Scribunto/includes/engines/LuaCommon/LuaEngine.php(512)
#0 /var/lib/mediawiki-1.39.4/extensions/Scribunto/includes/engines/LuaCommon/LuaEngine.php(162): Scribunto_LuaEngine->instantiatePHPLibrary()
#1 /var/lib/mediawiki-1.39.4/extensions/Scribunto/includes/engines/LuaCommon/LuaEngine.php(235): Scribunto_LuaEngine->load()
#2 /var/lib/mediawiki-1.39.4/extensions/Scribunto/includes/engines/LuaCommon/LuaModule.php(41): Scribunto_LuaEngine->getInterpreter()
#3 /var/lib/mediawiki-1.39.4/extensions/Scribunto/includes/engines/LuaCommon/LuaModule.php(58): Scribunto_LuaModule->getInitChunk()
#4 /var/lib/mediawiki-1.39.4/extensions/Scribunto/includes/Hooks.php(158): Scribunto_LuaModule->invoke()
#5 /var/lib/mediawiki-1.39.4/includes/parser/Parser.php(3437): MediaWiki\Extension\Scribunto\Hooks::invokeHook()
#6 /var/lib/mediawiki-1.39.4/includes/parser/Parser.php(3122): Parser->callParserFunction()
#7 /var/lib/mediawiki-1.39.4/includes/parser/PPFrame_Hash.php(275): Parser->braceSubstitution()
#8 /var/lib/mediawiki-1.39.4/includes/parser/Parser.php(2951): PPFrame_Hash->expand()
#9 /var/lib/mediawiki-1.39.4/includes/parser/Parser.php(1609): Parser->replaceVariables()
#10 /var/lib/mediawiki-1.39.4/includes/parser/Parser.php(723): Parser->internalParse()
#11 /var/lib/mediawiki-1.39.4/includes/content/WikitextContentHandler.php(301): Parser->parse()
#12 /var/lib/mediawiki-1.39.4/includes/content/ContentHandler.php(1721): WikitextContentHandler->fillParserOutput()
#13 /var/lib/mediawiki-1.39.4/includes/content/Renderer/ContentRenderer.php(47): ContentHandler->getParserOutput()
#14 /var/lib/mediawiki-1.39.4/includes/Revision/RenderedRevision.php(266): MediaWiki\Content\Renderer\ContentRenderer->getParserOutput()
#15 /var/lib/mediawiki-1.39.4/includes/Revision/RenderedRevision.php(237): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached()
#16 /var/lib/mediawiki-1.39.4/includes/Revision/RevisionRenderer.php(221): MediaWiki\Revision\RenderedRevision->getSlotParserOutput()
#17 /var/lib/mediawiki-1.39.4/includes/Revision/RevisionRenderer.php(158): MediaWiki\Revision\RevisionRenderer->combineSlotOutput()
#18 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}()
#19 /var/lib/mediawiki-1.39.4/includes/Revision/RenderedRevision.php(199): call_user_func()
#20 /var/lib/mediawiki-1.39.4/includes/poolcounter/PoolWorkArticleView.php(91): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#21 /var/lib/mediawiki-1.39.4/includes/poolcounter/PoolWorkArticleViewCurrent.php(97): PoolWorkArticleView->renderRevision()
#22 /var/lib/mediawiki-1.39.4/includes/poolcounter/PoolCounterWork.php(162): PoolWorkArticleViewCurrent->doWork()
#23 /var/lib/mediawiki-1.39.4/includes/page/ParserOutputAccess.php(299): PoolCounterWork->execute()
#24 /var/lib/mediawiki-1.39.4/includes/page/Article.php(714): MediaWiki\Page\ParserOutputAccess->getParserOutput()
#25 /var/lib/mediawiki-1.39.4/includes/page/Article.php(528): Article->generateContentOutput()
#26 /var/lib/mediawiki-1.39.4/includes/actions/ViewAction.php(78): Article->view()
#27 /var/lib/mediawiki-1.39.4/includes/MediaWiki.php(542): ViewAction->show()
#28 /var/lib/mediawiki-1.39.4/includes/MediaWiki.php(322): MediaWiki->performAction()
#29 /var/lib/mediawiki-1.39.4/includes/MediaWiki.php(904): MediaWiki->performRequest()
#30 /var/lib/mediawiki-1.39.4/includes/MediaWiki.php(562): MediaWiki->main()
#31 /var/lib/mediawiki-1.39.4/index.php(50): MediaWiki->run()
#32 /var/lib/mediawiki-1.39.4/index.php(46): wfIndexMain()
#33 {main}
`
What should have happened instead?:

If the displayTitle extension is disabled in LocalSettings.php, then the files can both be saved and purged. If it is re-enabled, purging gives the same backtrace. Note that neither file is using the DISPLAYTITLE magic word.

Software version (skip for WMF-hosted wikis like Wikipedia):
This was NOT a problem in MediaWiki 1.30 nor MediaWiki 1.35.11. It is a problem in MediaWiki 1.39.4. I tried copying the extension from MediaWiki 1.40.0 with same results.

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

Note that the DisplayTitleLuaLibrary function exists, but it is somehow not registered - but I know little about these things.

I had also tried loading DisplayTitle extension after Scribunto to no avail.

I had trouble updating a medium sized site from 1.30 to 1.35.11 then 1.39.4 on shared hosting, so decided to do so on my laptop where I have full root access. I created a brand new (empty) DB, but with many extensions, one being DisplayTitle. I had no trouble editing and saving the Main Page. But I could not save the contents of Template:Test nor Module:Test (small hello world) until I disabled DisplayTitle, at which point "hello world" was correctly displayed (I was testing scribunto, not DisplayTitle).

I had previously mentioned this problem on discord, then mw:Project:Support desk which suggested raising it here.

Event Timeline

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

[mediawiki/extensions/DisplayTitle@master] Fix Lua class name

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

cicalese subscribed.

Thank you for reporting this. The patch should resolve the issue.

Change 947493 merged by jenkins-bot:

[mediawiki/extensions/DisplayTitle@master] Fix Lua class name

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

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

[mediawiki/extensions/DisplayTitle@REL1_39] Fix Lua class name

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

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

[mediawiki/extensions/DisplayTitle@REL1_40] Fix Lua class name

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

cicalese claimed this task.

Change 947450 merged by jenkins-bot:

[mediawiki/extensions/DisplayTitle@REL1_39] Fix Lua class name

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

Change 947451 merged by jenkins-bot:

[mediawiki/extensions/DisplayTitle@REL1_40] Fix Lua class name

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