r110897 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110896‎ | r110897 | r110898 >
Date:23:57, 7 February 2012
Author:aaron
Status:ok (Comments)
Tags:core 
Comment:
r96546: Made FeedUtils::formatDiff() use the new LogFormatter class rather than a broken LogPage::actionText() call (the <summary> tag only had the log action name in it). This change means that log actions in feeds now have the user name in them, unlike 1.18. Also, broke a long code line.
Modified paths:
  • /trunk/phase3/includes/FeedUtils.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/FeedUtils.php
@@ -57,18 +57,17 @@
5858 $timestamp = wfTimestamp( TS_MW, $row->rc_timestamp );
5959 $actiontext = '';
6060 if( $row->rc_type == RC_LOG ) {
61 - if( $row->rc_deleted & LogPage::DELETED_ACTION ) {
62 - $actiontext = wfMsgHtml('rev-deleted-event');
63 - } else {
64 - $actiontext = LogPage::actionText( $row->rc_log_type, $row->rc_log_action,
65 - $titleObj, RequestContext::getMain()->getSkin(), LogPage::extractParams($row->rc_params,true,true) );
66 - }
 61+ $rcRow = (array)$row; // newFromRow() only accepts arrays for RC rows
 62+ $actiontext = LogFormatter::newFromRow( $rcRow )->getActionText();
6763 }
6864 return self::formatDiffRow( $titleObj,
6965 $row->rc_last_oldid, $row->rc_this_oldid,
7066 $timestamp,
71 - ($row->rc_deleted & Revision::DELETED_COMMENT) ? wfMsgHtml('rev-deleted-comment') : $row->rc_comment,
72 - $actiontext );
 67+ ($row->rc_deleted & Revision::DELETED_COMMENT)
 68+ ? wfMsgHtml('rev-deleted-comment')
 69+ : $row->rc_comment,
 70+ $actiontext
 71+ );
7372 }
7473
7574 /**

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96546Enabled MoveLogFormatter...nikerabbit09:09, 8 September 2011

Comments

#Comment by Nikerabbit (talk | contribs)   20:43, 9 February 2012

Feels a bit stupid to convert it to first array, when newFromRow converts it back to object immediately. Maybe fix newFromRow to accept objects instead?

Status & tagging log