Mediawiki: oojs-ui.styles.icons module causes 500 server error

330 Views Asked by At

I installed VisualEditor for Mediawiki and configured it correctly, so that the editing mode worked fine. But after upgrading to a newer Mediawiki version, VisualEditor doesn't work anymore.

Once I checked my DOM console I noticed, that the issue is caused by a module called oojs-ui.styles.icons creating a 500 server error. I also took a look into my error.log file. These are the essential details:

2016/01/31 03:33:47 [error] 1178#0: *50446 FastCGI sent in stderr: "PHP message: PHP Warning:  DOMDocument::load(): I/O warning : failed to load external entity "/var/www/html/Wiki/resources/lib/oojs-ui/themes/mediawiki/images/icons/add.svg" in /var/www/html/Wiki/includes/resourceloader/ResourceLoaderImage.php on line 275
PHP message: PHP Notice:  Trying to get property of non-object in /var/www/html/Wiki/includes/resourceloader/ResourceLoaderImage.php on line 278
PHP message: PHP Fatal error:  Call to a member function appendChild() on a non-object in /var/www/html/Wiki/includes/resourceloader/ResourceLoaderImage.php on line 281" while reading response header from upstream, client: 123.123.123.123, server: domain.com, request: "GET /load.php?debug=true&modules=oojs-ui.styles.icons&* HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "domain.com"

Obviously the filepath can't be recognized, because of the " attribute. So I checked line 275 of the file /var/www/html/Wiki/includes/resourceloader/ResourceLoaderImage.php, which contains the following:

protected function variantize( $variantConf, ResourceLoaderContext $context ) {
    $dom = new DomDocument;
    $dom->load( $this->getPath( $context ) ); ########## Line 275
    $root = $dom->documentElement;
    $wrapper = $dom->createElement( 'g' );
    while ( $root->firstChild ) {
        $wrapper->appendChild( $root->firstChild );
    }
    $root->appendChild( $wrapper );
    $wrapper->setAttribute( 'fill', $variantConf['color'] );
    return $dom->saveXml();
}

Normally, the php function getPath() should work fine, shouldn't it? I am wondering why this is not working. I updated every extension afterwards but still no changes.

What do I have to do, in order to fix the error message from the error.log file?

0

There are 0 best solutions below