[Mediawiki-l] ParserFunctions seem not to be working

Frank Middleton f.middleton at apogeect.com
Wed Sep 19 20:30:53 UTC 2007


In solving a problem with maintenance/dumpBackup.php (fixed by using
php5 -c /path_to/php.ini) I found this in the previously disabled log

"" is not a valid magic thingie for "#expr"
"" is not a valid magic thingie for "#if"
"" is not a valid magic thingie for "#ifeq"
"" is not a valid magic thingie for "#ifexpr"
"" is not a valid magic thingie for "#switch"
"" is not a valid magic thingie for "#ifexist"
"" is not a valid magic thingie for "#time"

It seems that wfParserFunctionsLanguageGetMagic isn't being
called for some reason. The following line was commented out
in ParserFunctions.php

$wgHooks['LanguageGetMagic'][]       = 'wfParserFunctionsLanguageGetMagic';

but uncommenting it appears to make no difference. Could one of you
php gurus out there suggest a way of debugging this? Doubtless the
non-working [[subst...]] fails for a similar reason. Editing the
php files isn't a problem but the internals of the hook logic is
somewhat inscrutable to a php neophyte. Looking for tips, not a 
fix. Thanks!


Frank Middleton wrote:
> Having spent a day re-reading TFM and Googling, I am getting
> no closer to solving a problem with parser functions not working.
> 
> Something complicated like DPL works like a charm, but not something
> basic like {{#if: {{{x|}}}|yes|no}} which renders as {{#if: |yes|no}}.
> Obviously I am missing something /really/ fundamental! I believe it
> is installed correctly:
> 
> Special pages Special:Version:
> 
>     * MediaWiki: 1.10.1
>     * PHP: 5.2.0 (cgi-fcgi)
>     * MySQL: 4.1.21-standard 
> 
> Parser hooks
> DynamicPageList2 (version 1.3.1)
> ParserFunctions
> 
> Extension functions
> wfSetupParserFunctions, wf_include, wfDynamicPageList3 and wfDynamicPageList2
> 
> Parser function hooks
> #expr, #if, #ifeq, #ifexpr, #switch, #ifexist, #time, dpl, int, ns, urlencode, lcfirst, ucfirst, lc, uc, localurl, localurle, fullurl, fullurle, formatnum, grammar, plural, numberofpages, numberofusers, numberofarticles, numberoffiles, numberofadmins, numberofedits, language, padleft, padright, anchorencode, special and defaultsort
> 
> $ grep ParserFunctions LocalSettings.php
> require_once( "$IP/extensions/ParserFunctions/ParserFunctions.php" );
> $ ls extensions/ParserFunctions/ParserFunctions.php
> extensions/ParserFunctions/ParserFunctions.php
> ls extensions/ExtensionFunctions.php
> extensions/ExtensionFunctions.php
> 
> Any hints on how to fix this would be much appreciated!
> 
> Thanks -- Frank
> 



More information about the MediaWiki-l mailing list