Page MenuHomePhabricator

ParserFunctions.php breaks down on hebrew mediawiki 1.10.0
Closed, ResolvedPublic

Description

Author: spamfree

Description:
I have just upgraded and I kept getting several of these per page:

Warning: array_slice() [function.array-slice]: The first argument should be an array in /home/astrolo4/public_html/astrology/w/languages/Language.php on line 1139

There is a bug I'm just about to report, with languages/language.php >> getMagic which creates these ugly notices if a $wgParser->setFunctionHook has been set and a magicWord has not been assigned to it.

Currently, ParserFunctions comes with a special section for the "he" (hebrew) langCode, which does not implement a magicWord for the functionHook "titleparts", which produces this message out-of-the-box, once (unless the person has previously fiddled with the hooks as in my case).

Please insert into extensions/ParserFunctions/ParserFunctions.php, function wfParserFunctionsLanguageGetMagic, under switch "he":

$magicWords['titleparts'] = array( 0, 'חלק בכותרת', 'titleparts' );

Thanks,
Nate


Version: unspecified
Severity: major

Details

Reference
bz10165

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 9:51 PM
bzimport added a project: ParserFunctions.
bzimport set Reference to bz10165.
bzimport added a subscriber: Unknown Object (MLST).

(In reply to comment #0)

Please insert into extensions/ParserFunctions/ParserFunctions.php, function
wfParserFunctionsLanguageGetMagic, under switch "he":

$magicWords['titleparts'] = array( 0, 'חלק בכותרת', 'titleparts' );

Added with r22789 but I am unsure if this fix the problem in general. I leave the bug open.

robchur wrote:

I fixed the general problem in r22820.