Extension talk:FileLink

Guys a bug when running this on MW 1.10 Internal error Detected bug in an extension! Hook filelinkDo failed to return a value; should return true to continue hook processing or false to abort.

Backtrace:


 * 1) 0 /var/www/html/mediawiki/includes/Parser.php(332): wfRunHooks('ParserBeforeTid...', Array)
 * 2) 1 /var/www/html/mediawiki/includes/Article.php(3017): Parser->parse('?Edit [[Hea...', Object(Title), Object(ParserOptions), true, true, 915)
 * 3) 2 /var/www/html/mediawiki/includes/Article.php(841): Article->outputWikiText('?Edit [[Hea...', false)
 * 4) 3 /var/www/html/mediawiki/includes/Wiki.php(383): Article->view
 * 5) 4 /var/www/html/mediawiki/includes/Wiki.php(48): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
 * 6) 5 /var/www/html/mediawiki/index.php(89): MediaWiki->initialize(Object(Title), Object(OutputPage), Object(User), Object(WebRequest))
 * 7) 6 {main}

Bug with MediaWiki 1.11.0
I installed and used the FileLink-Extension with mediawiki version 1.10.0 without problem, but after upgrading to version 1.11.0 I get the following error message whenever I try to edit a page.

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

Backtrace:


 * 1) 0 /opt/lampp/htdocs/_fhbwiki/includes/Parser.php(332): wfRunHooks('ParserBeforeTid...', Array)
 * 2) 1 /opt/lampp/htdocs/_fhbwiki/includes/OutputPage.php(474): Parser->parse('Abbrechen', Object(Title), Object(ParserOptions), true, true, NULL)
 * 3) 2 /opt/lampp/htdocs/_fhbwiki/includes/GlobalFunctions.php(593): OutputPage->parse('Abbrechen', true, true)
 * 4) 3 /opt/lampp/htdocs/_fhbwiki/includes/EditPage.php(1065): wfMsgExt('cancel', Array)
 * 5) 4 /opt/lampp/htdocs/_fhbwiki/includes/EditPage.php(433): EditPage->showEditForm
 * 6) 5 /opt/lampp/htdocs/_fhbwiki/includes/EditPage.php(285): EditPage->edit
 * 7) 6 /opt/lampp/htdocs/_fhbwiki/includes/Wiki.php(437): EditPage->submit
 * 8) 7 /opt/lampp/htdocs/_fhbwiki/includes/Wiki.php(48): MediaWiki->performAction(Object(OutputPage), Object(Article), Object(Title), Object(User), Object(WebRequest))
 * 9) 8 /opt/lampp/htdocs/_fhbwiki/index.php(89): MediaWiki->initialize(Object(Title), Object(OutputPage), Object(User), Object(WebRequest))
 * 10) 9 {main}

Fix for 1.11.0 +
Every function which is registered as a MediaWiki hook must return something so just add TRUE to any Return ;

function wfDataLanguageGetMagic( &$magicWords, $langCode ) { switch ( $langCode ) { default: $magicWords['data']         = array( 0, 'data' ); $magicWords['sort']         = array( 0, 'sort' ); }   return true; } and at the end //Either not an edit attempt, or not logged in    //Do nothing be silent without bothering innocent visitors. } return TRUE; } ?>