r56317 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56316‎ | r56317 | r56318 >
Date:18:10, 14 September 2009
Author:mrzman
Status:ok
Tags:
Comment:
Replace the user rename log display for non-existent userpages with a hook (followup to r56251).
Update for Renameuser extension to follow.

Also make docs for LogEventsList::showLogExtract() actually useful
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -589,7 +589,6 @@
590590 'permissionserrorstext-withaction',
591591 'recreate-moveddeleted-warn',
592592 'moveddeleted-notice',
593 - 'renamed-notice',
594593 'log-fulllog',
595594 'edit-hook-aborted',
596595 'edit-gone-missing',
Index: trunk/phase3/docs/hooks.txt
@@ -1231,6 +1231,9 @@
12321232
12331233 'SetupAfterCache': Called in Setup.php, after cache objects are set
12341234
 1235+'ShowMissingArticle': Called when generating the output for a non-existent page
 1236+$article: The article object corresponding to the page
 1237+
12351238 'ShowRawCssJs': Customise the output of raw CSS and JavaScript in page views
12361239 $text: Text being shown
12371240 $title: Title of the custom script/stylesheet page
Index: trunk/phase3/includes/Article.php
@@ -1201,20 +1201,17 @@
12021202 public function showMissingArticle() {
12031203 global $wgOut, $wgRequest, $wgUser;
12041204
1205 - # Show info in user (talk) namespace. Does the user exist and if not, has he been renamed.
 1205+ # Show info in user (talk) namespace. Does the user exist?
12061206 if ( $this->mTitle->getNamespace() == NS_USER || $this->mTitle->getNamespace() == NS_USER_TALK ) {
12071207 $id = User::idFromName( $this->mTitle->getBaseText() );
12081208 $ip = User::isIP( $this->mTitle->getBaseText() );
12091209 if ( $id == 0 && !$ip ) { # User does not exist
12101210 $wgOut->wrapWikiMsg( '<div class="mw-userpage-userdoesnotexist error">$1</div>',
12111211 array( 'userpage-userdoesnotexist-view', $this->mTitle->getBaseText() ) );
1212 -
1213 - # Show rename log because user does not exist.
1214 - $parent = $this->mTitle->getNsText() . ":" . $this->mTitle->getBaseText();
1215 - LogEventsList::showLogExtract( $wgOut, 'renameuser', $parent, '', 10, array(), false, 'renamed-notice' );
12161212 }
12171213
12181214 }
 1215+ wfRunHooks( 'ShowMissingArticle', array( $this ) );
12191216 # Show delete and move logs
12201217 LogEventsList::showLogExtract( $wgOut, array( 'delete', 'move' ),
12211218 $this->mTitle->getPrefixedText(), '', 10, array( "log_action != 'revision'" ), false, 'moveddeleted-notice');
Index: trunk/phase3/includes/LogEventsList.php
@@ -569,10 +569,10 @@
570570 * Show log extract. Either with text and a box (set $msgKey) or without (don't set $msgKey)
571571 * @param $out OutputPage or String-by-reference
572572 * @param $types String or Array
573 - * @param $page String
574 - * @param $user String
 573+ * @param $page String The page title to show log entries for
 574+ * @param $user String The user who made the log entries
575575 * @param $lim Integer Limit of items to show, default is 50
576 - * @param $conds Array
 576+ * @param $conds Array Extra conditions for the query
577577 * @param $showIfEmpty boolean Set to false if you don't want any output in case the loglist is empty
578578 * if set to true (default), "No matching items in log" is displayed if loglist is empty
579579 * @param $msgKey String if you want a nice box with a message, set this to the key of the message
@@ -663,13 +663,13 @@
664664 /**
665665 * constructor
666666 * @param $list LogEventsList
667 - * @param $types String or Array
668 - * @param $user String
669 - * @param $title String
670 - * @param $pattern String
671 - * @param $conds Array
672 - * @param $year Integer
673 - * @param $month Integer
 667+ * @param $types String or Array log types to show
 668+ * @param $user String The user who made the log entries
 669+ * @param $title String The page title the log entries are for
 670+ * @param $pattern String Do a prefix search rather than an exact title match
 671+ * @param $conds Array Extra conditions for the query
 672+ * @param $year Integer The year to start from
 673+ * @param $month Integer The month to start from
674674 */
675675 public function __construct( $list, $types = array(), $user = '', $title = '', $pattern = '',
676676 $conds = array(), $year = false, $month = false, $tagFilter = '' )
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1342,8 +1342,6 @@
13431343 The deletion and move log for this page are provided here for convenience:",
13441344 'moveddeleted-notice' => 'This page has been deleted.
13451345 The deletion and move log for the page are provided below for reference.',
1346 -'renamed-notice' => 'This user has been renamed.
1347 -The rename log is provided below for reference.',
13481346 'log-fulllog' => 'View full log',
13491347 'edit-hook-aborted' => 'Edit aborted by hook.
13501348 It gave no explanation.',
Index: trunk/phase3/RELEASE-NOTES
@@ -222,8 +222,9 @@
223223 excerpt from the block log.
224224 * (bug 19646) New hook: ImgAuthBeforeStream for tests and functionality before
225225 file is streamed to user, but only when using img_auth
226 -* Note on non-existing user and user talk pages if user does not exist and show
227 - renameuser log if the user has been renamed
 226+* Note on non-existing user and user talk pages if user does not exist
 227+* New hook ShowMissingArticle so extensions can modify the output for
 228+ non-existent pages.
228229
229230 === Bug fixes in 1.16 ===
230231

Follow-up revisions

RevisionCommit summaryAuthorDate
r56318Use the new ShowMissingArticle hook (r56317) to show the rename log on userpa...mrzman18:11, 14 September 2009
r56322Follow-up to r56317: rebuild messages filessiebrand18:22, 14 September 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r56251Creating new function wgOutput->showLogs and including new information on vie...churchofemacs02:07, 13 September 2009

Status & tagging log