r40633 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40632‎ | r40633 | r40634 >
Date:04:39, 9 September 2008
Author:jdpond
Status:old
Tags:
Comment:
Fixed so that 'EditSectionLink' hook works again.
Error was introduced in linker.php r38149, typo or cut and paste error when expanded to use wfMsgHtml( 'editsection-brackets' - used $url when should have been $result
Also changed $url to $link as per TimStarling suggestion.
Modified paths:
  • /trunk/phase3/includes/Linker.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Linker.php
@@ -1452,7 +1452,7 @@
14531453 if( !is_null( $tooltip ) ) {
14541454 $attribs['title'] = wfMsg( 'editsectionhint', $tooltip );
14551455 }
1456 - $url = $this->link( $nt, wfMsg('editsection'),
 1456+ $link = $this->link( $nt, wfMsg('editsection'),
14571457 $attribs,
14581458 array( 'action' => 'edit', 'section' => $section ),
14591459 array( 'noclasses', 'known' )
@@ -1466,19 +1466,19 @@
14671467 $attribs = " title=\"$attribs\"";
14681468 }
14691469 $result = null;
1470 - wfRunHooks( 'EditSectionLink', array( &$this, $nt, $section, $attribs, $url, &$result ) );
 1470+ wfRunHooks( 'EditSectionLink', array( &$this, $nt, $section, $attribs, $link, &$result ) );
14711471 if( !is_null( $result ) ) {
14721472 # For reverse compatibility, add the brackets *after* the hook is
14731473 # run, and even add them to hook-provided text. (This is the main
14741474 # reason that the EditSectionLink hook is deprecated in favor of
14751475 # DoEditSectionLink: it can't change the brackets or the span.)
1476 - $result = wfMsgHtml( 'editsection-brackets', $url );
 1476+ $result = wfMsgHtml( 'editsection-brackets', $result );
14771477 return "<span class=\"editsection\">$result</span>";
14781478 }
14791479
14801480 # Add the brackets and the span, and *then* run the nice new hook, with
14811481 # clean and non-redundant arguments.
1482 - $result = wfMsgHtml( 'editsection-brackets', $url );
 1482+ $result = wfMsgHtml( 'editsection-brackets', $link );
14831483 $result = "<span class=\"editsection\">$result</span>";
14841484
14851485 wfRunHooks( 'DoEditSectionLink', array( $this, $nt, $section, $tooltip, &$result ) );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r38149Linker::doEditSectionLink() and Linker::doEditSectionLinkForOther() and their...simetrical20:33, 28 July 2008