r98431 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98430‎ | r98431 | r98432 >
Date:19:03, 29 September 2011
Author:ialex
Status:ok
Tags:
Comment:
Per Aaron, fix for r98012: make Title object be handled correctly and document where there can now be a Title object
Modified paths:
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -1191,8 +1191,8 @@
11921192
11931193 'LogEventsListShowLogExtract': called before the string is added to OutputPage. Returning false will prevent the string from being added to the OutputPage
11941194 &$s: html string to show for the log extract
1195 -$types: String or Array (''isn't documented on showLogExtract() yet, not sure what it is'')
1196 -$page: String The page title to show log entries for
 1195+$types: String or Array Log types to show
 1196+$page: String or Title The page title to show log entries for
11971197 $user: String The user who made the log entries
11981198 $param: Associative Array with the following additional options:
11991199 - lim Integer Limit of items to show, default is 50
Index: trunk/phase3/includes/LogEventsList.php
@@ -600,8 +600,8 @@
601601 * Show log extract. Either with text and a box (set $msgKey) or without (don't set $msgKey)
602602 *
603603 * @param $out OutputPage|String-by-reference
604 - * @param $types String or Array
605 - * @param $page String The page title to show log entries for
 604+ * @param $types String|Array Log types to show
 605+ * @param $page String|Title The page title to show log entries for
606606 * @param $user String The user who made the log entries
607607 * @param $param Associative Array with the following additional options:
608608 * - lim Integer Limit of items to show, default is 50
@@ -679,8 +679,11 @@
680680 }
681681 if( $pager->getNumRows() > $pager->mLimit ) { # Show "Full log" link
682682 $urlParam = array();
683 - if ( $page != '')
 683+ if ( $page instanceof Title ) {
 684+ $urlParam['page'] = $page->getPrefixedDBkey();
 685+ } elseif ( $page != '' ) {
684686 $urlParam['page'] = $page;
 687+ }
685688 if ( $user != '')
686689 $urlParam['user'] = $user;
687690 if ( !is_array( $types ) ) # Make it an array, if it isn't
@@ -758,7 +761,7 @@
759762 * @param $list LogEventsList
760763 * @param $types String or Array: log types to show
761764 * @param $performer String: the user who made the log entries
762 - * @param $title String or Title: the page title the log entries are for
 765+ * @param $title String|Title: the page title the log entries are for
763766 * @param $pattern String: do a prefix search rather than an exact title match
764767 * @param $conds Array: extra conditions for the query
765768 * @param $year Integer: the year to start from

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r98012Allow LogEventsList::showLogExtract() to get a Title object instead of having...ialex17:52, 24 September 2011

Status & tagging log