0

我安装了 VisualEditor for Mediawiki 并正确配置了它,这样编辑模式就可以正常工作了。但是在升级到更新的 Mediawiki 版本后,VisualEditor 不再工作了。

一旦我检查了我的 DOM 控制台,我注意到这个问题是由一个名为 oojs-ui.styles.icons 的模块引起的,它创建了一个 500 服务器错误。我还查看了我的 error.log 文件。这些是基本的细节:

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"

"显然,由于属性的原因,无法识别文件路径。所以我检查了文件 /var/www/html/Wiki/includes/resourceloader/ResourceLoaderImage.php 的第 275 行,其中包含以下内容:

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();
}

通常,php 函数getPath()应该可以正常工作,不是吗?我想知道为什么这不起作用。之后我更新了每个扩展,但仍然没有变化。

为了修复 error.log 文件中的错误消息,我该怎么做?

4

0 回答 0