Page MenuHomePhabricator

Preprocessor_DOM causes fatal errors when called in certain ways
Closed, ResolvedPublic

Description

Given the following Lua module:

local p = {}

function p.main(frame)
return 'Hello world'
end

function p.fnOnly(frame)
return mw.getCurrentFrame():callParserFunction('#invoke',{'Sandbox/Jackmcbarn', 'main'})
end

function p.oneArg(frame)
return mw.getCurrentFrame():callParserFunction('#invoke',{'Sandbox/Jackmcbarn', 'main', 'baz'})
end

function p.twoArgs(frame)
return mw.getCurrentFrame():callParserFunction('#invoke',{'Sandbox/Jackmcbarn', 'main', 'baz', 'qux'})
end

return p

Any call to twoArgs will result in "PHP fatal error in /usr/local/apache/common-local/php-1.24wmf17/includes/parser/Preprocessor_DOM.php line 1042:
Call to a member function item() on a non-object". This only occurs on wikis that use Preprocessor_DOM rather than Preprocessor_Hash.


Version: unspecified
Severity: normal

Details

Reference
bz70046

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 3:28 AM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz70046.

Change 156299 had a related patch set uploaded by Anomie:
Handle multiple ownerDocuments for args in Preprocessor_DOM

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

Change 156299 merged by jenkins-bot:
Handle multiple ownerDocuments for args in Preprocessor_DOM

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