r106545 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106544‎ | r106545 | r106546 >
Date:01:46, 18 December 2011
Author:mah
Status:reverted
Tags:
Comment:
followup r88898 -- move BeforeInitialize hook to where it can be
called in a way that matches the documented parameters

As it was, when an extension tried to use BeforeInitialize with the
documented parameters this resulted in an exception:

Detected bug in an extension! Hook HookFunctionName has invalid
call signature; Parameter 2 to HookFunctionName() expected to be a
reference, value given
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -146,9 +146,6 @@
147147 $output->setPrintable();
148148 }
149149
150 - wfRunHooks( 'BeforeInitialize',
151 - array( &$title, null, &$output, &$user, $request, $this ) );
152 -
153150 // Invalid titles. Bug 21776: The interwikis must redirect even if the page name is empty.
154151 if ( is_null( $title ) || ( $title->getDBkey() == '' && $title->getInterwiki() == '' ) ||
155152 $title->isSpecial( 'Badtitle' ) )
@@ -270,6 +267,8 @@
271268 wfProfileOut( __METHOD__ );
272269 throw new MWException( "Shouldn't happen: MediaWiki::initializeArticle() returned neither an object nor a URL" );
273270 }
 271+ wfRunHooks( 'BeforeInitialize',
 272+ array( &$title, &$article, &$output, &$user, $request, $this ) );
274273 }
275274
276275 if ( $pageView ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r106563Revert r106545 and pass a null variable by ref (also updated the documentatio...ialex14:48, 18 December 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r88898Merged MediaWiki::performRequestForTitle() and MediaWiki::handleSpecialCases(...ialex16:41, 26 May 2011

Status & tagging log