mediawiki4intranet / Wikilog

Heavily improved Wikilog extension
http://wiki.4intra.net/Wikilog
GNU General Public License v2.0
10 stars 10 forks source link

ArticleFromTitle hook breaks talk pages #9

Closed jneug closed 8 years ago

jneug commented 8 years ago

Using Wikilog with Semantic MediaWiki breaks talk pages, because WikilogCommentsPage::createInstance sets $article to false and not null, if comments are disabled. SMW expects $article to be either null or to implement Page and throws an fatal error for false.

A quick fix is to replace line 337 in Wikilog.php with

        if ( $article === false )
            $article = null;
        return !is_null($article); // continue hook processing if createInstance returned false

but I think it would be more appropriate to make WikilogCommentsPage::createInstance return null instead of false.

I tested this locally on MediaWiki 1.26.0, PHP 5.6.10 (MAMP 3.4), MySQL 5.5.42.

vitalif commented 8 years ago

Ok, thanks, I've committed the fix to master.