Skip to content

Proper SemanticMediaWiki initialization leads to Fatal error #37

@vedmaka

Description

@vedmaka

Reproducible on Canasta's latest image tag, which is 1.43.5-20251202-cd387ac at the moment of the bug report

Adding the following lines that should enable the SemanticMediaWiki extension (per docs) to the LocalSettings.php file:

wfLoadExtension( 'SemanticMediaWiki' );
enableSemantics( 'wiki-example.com' );

Is leading to the following Fatal error:


Fatal error: Uncaught Error: Call to undefined function enableSemantics() in 
/mediawiki/config/LocalSettings.php:142 Stack trace: #0 
/var/www/mediawiki/w/CanastaDefaultSettings.php(104): require_once() #1 
/var/www/mediawiki/w/LocalSettings.php(8): require_once('...') #2 
/var/www/mediawiki/w/includes/Setup.php(222): require_once('...') #3 
/var/www/mediawiki/w/includes/WebStart.php(85): require_once('...') #4 
/var/www/mediawiki/w/index.php(50): require('...') #5
{main} thrown in /mediawiki/config/LocalSettings.php on line 142

The enableSemantics() global function is not available during LocalSettings.php call because per-extension composer install in https://github.com/CanastaWiki/CanastaBase/blob/master/_sources/scripts/extensions-skins.php#L89 does affect the global autoloader, and thus the function never gets loaded until the extension itself is loaded (which happens much later than the wfLoadExtension() function call)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions