1

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

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。

4

1 回答 1

0

在与 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 ) {
于 2013-10-25T02:13:34.013 回答