【问题标题】:FlaggedRevs error after PHP upgrade from 5.2 to 5.3PHP 从 5.2 升级到 5.3 后出现 FlaggedRevs 错误
【发布时间】:2013-10-25 02:13:34
【问题描述】:

升级后上传新文件时出错:

Warning: Parameter 1 to FlaggedRevsHooks::imagePageFindFile() expected to be a reference, value given in /home/user/www/site.com/includes/Hooks.php on line 117 

Detected bug in an extension! Hook FlaggedRevsHooks::imagePageFindFile failed to return a value; should return true to continue hook processing or false to abort.

Backtrace:

#0 /home/user/www/site.com/includes/ImagePage.php(39): wfRunHooks('ImagePageFindFi...', Array)
#1 /home/user/www/site.com/includes/ImagePage.php(185): ImagePage->loadFile()
#2 /home/user/www/site.com/includes/Wiki.php(289): ImagePage->getFile()
#3 /home/user/www/site.com/includes/Wiki.php(60): MediaWiki->initializeArticle(Object(Title), Object(WebRequest))
#4 /home/user/www/site.com/index.php(116): MediaWiki->initialize(Object(Title), NULL, Object(OutputPage), Object(User), Object(WebRequest))
#5 {main}

MediaWiki 版本 1.15.5。

【问题讨论】:

    标签: php mediawiki mediawiki-extensions


    【解决方案1】:

    在与 1.16.0 版本比较后找到了解决方案。在FlaggedRevs.hooks.php 找到:

    public static function imagePageFindFile( &$imagePage, &$normalFile, &$displayFile ) {
    

    并替换为:

    public static function imagePageFindFile( $imagePage, &$normalFile, &$displayFile ) {
    

    查找:

    public static function autoPromoteUser( $article, $user, &$text, &$summary, &$m, &$a, &$b, &$f, $rev ) {
    

    替换为:

    public static function autoPromoteUser( $article, $user, $text, $summary, $m, $a, $b, &$f, $rev ) { 
    

    查找:

    public static function maybeNullEditReview( $article, $user, &$text, &$summary, &$m, &$a, &$b,
        &$f, $rev, &$s, $baseId )
    

    替换为:

    public static function maybeNullEditReview( $article, $user, $text, $summary, $m, $a, $b,
        $f, $rev, &$s, $baseId )
    

    查找:

    public static function injectReviewDiffURLParams( &$article, &$sectionAnchor, &$extraQuery ) { 
    

    替换为:

    public static function injectReviewDiffURLParams( $article, &$sectionAnchor, &$extraQuery ) {
    

    【讨论】:

      猜你喜欢
      • 2019-02-14
      • 2017-02-04
      • 2010-12-09
      • 2012-07-23
      • 1970-01-01
      • 1970-01-01
      • 2011-10-24
      • 1970-01-01
      • 2016-03-09
      相关资源
      最近更新 更多