Page MenuHomePhabricator

Extension:LogoFunctions.php doesn't set the page logo as of MediaWiki 1.31.x
Closed, ResolvedPublic


According to the {{#setlogo:}} tag no longer has any effect in [[mw:extension:LogoFunctions]] as $wgLogo is read (and the skin generated) before the tag is parsed.

This used to work before the MW1.31 upgrade, and was in use on a few Uncyclopedias including English ( It now does nothing.

Event Timeline

Carlb created this task.Oct 30 2018, 7:19 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 30 2018, 7:19 PM
Carlb added a comment.Oct 30 2018, 7:23 PM

And no, the text formatting of that PHP code stub for the kludge {{#logotipo:}} tag (which also is broken by MW1.31) should have been:

 # Define a setup function
 $wgExtensionFunctions[] = 'wfLogotipoFunction_Setup';
 # Add a hook to initialise the magic word
 $wgHooks['LanguageGetMagic'][]       = 'wfLogotipoFunction_Magic';
 function wfLogotipoFunction_Setup() {
        global $wgParser;
        # Set a function hook associating the "logotipo" magic word with our function
        $wgParser->setFunctionHook( 'logotipo', 'wfLogotipoFunction_Render' );
 function wfLogotipoFunction_Magic( &$magicWords, $langCode ) {
        # Add the magic word
        # The first array element is case sensitive, in this case it is not case sensitive
        # All remaining elements are synonyms for our parser function
        $magicWords['logotipo'] = array( 0, 'logotipo' );
        # unless we return true, other parser functions extensions won't get loaded.
        return true;
 function wfLogotipoFunction_Render( &$parser, $param1 = '' ) {
	global $wgLogo;

        # The parser function itself
        # The input parameters are wikitext with templates expanded
         # The output should be wikitext too

        $parser ->disableCache();
	$wgLogo = $param1;
        return "";

Carlb updated the task description. (Show Details)Oct 30 2018, 8:18 PM
edwardspec updated the task description. (Show Details)Nov 5 2018, 6:53 PM
edwardspec added a subscriber: edwardspec.
Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptApr 5 2019, 12:39 AM

Probably caused by the way the logo is applied being changed?

Whatever the case, RL currently applies the background image via the mw-wiki-logo css class when using a ResourceLoaderSkinModule classed module, so need to make LogoFunctions interact properly with that...

Isarra moved this task from uh wat to fix this on the Uncyclomedia board.Apr 5 2019, 12:47 AM
Isarra updated the task description. (Show Details)Apr 5 2019, 1:40 AM

Change 509935 had a related patch set uploaded (by Isarra; owner: Isarra):
[mediawiki/extensions/LogoFunctions@master] Use ResourceLoader to work with current MediaWiki

Change 536718 had a related patch set uploaded (by Isarra; owner: Isarra):
[mediawiki/extensions/LogoFunctions@master] Redo setLogo rendering using some plain CSS smashed onto the page

Change 509935 abandoned by Isarra:
Use ResourceLoader to work with current MediaWiki

Okay, implemented properly in other patch!

Change 536718 merged by jenkins-bot:
[mediawiki/extensions/LogoFunctions@master] Reimplement extension using plain CSS smashed onto the page

Isarra closed this task as Resolved.Sep 15 2019, 4:31 PM
Isarra claimed this task.