r90384 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90383‎ | r90384 | r90385 >
Date:05:45, 19 June 2011
Author:bawolff
Status:ok
Tags:
Comment:
(bug 29485) For rss feed of the RC, it groups consecutive edits by same user, but then links
to the diff of only one edit, instead of all of the grouped edits (but displays the combined diff directly in feed)

Also well I'm here, make it not group new page creation with subsequent edit, because that doesn't really work right.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/ChangesFeed.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -101,6 +101,10 @@
102102 without reloading the page
103103 * (bug 29325) Setting $wgStrictFileExtensions to false gives incorrect warning
104104 * (bug 29437) Multiple apostrophes in deleted article title cause odd rendering
 105+* (bug 29485) RSS feed of Special:RecentChange grouped together multiple
 106+ consecutive edits by same user in included diff, but then linked to
 107+ a single ungrouped diff.
 108+* Do not try to group together a page creation and edit in the RSS feed of RC.
105109
106110 === API changes in 1.19 ===
107111 * BREAKING CHANGE: action=watch now requires POST and token.
Index: trunk/phase3/includes/ChangesFeed.php
@@ -149,6 +149,7 @@
150150 $n = 0;
151151 foreach( $rows as $obj ) {
152152 if( $n > 0 &&
 153+ $obj->rc_type == RC_EDIT &&
153154 $obj->rc_namespace >= 0 &&
154155 $obj->rc_cur_id == $sorted[$n-1]->rc_cur_id &&
155156 $obj->rc_user_text == $sorted[$n-1]->rc_user_text ) {
@@ -164,10 +165,21 @@
165166 $talkpage = MWNamespace::canTalk( $obj->rc_namespace ) ? $title->getTalkPage()->getFullUrl() : '';
166167 // Skip items with deleted content (avoids partially complete/inconsistent output)
167168 if( $obj->rc_deleted ) continue;
 169+
 170+ if ( $obj->rc_this_oldid ) {
 171+ $url = $title->getFullURL(
 172+ 'diff=' . $obj->rc_this_oldid .
 173+ '&oldid=' . $obj->rc_last_oldid
 174+ );
 175+ } else {
 176+ // log entry or something like that.
 177+ $url = $title->getFullURL();
 178+ }
 179+
168180 $item = new FeedItem(
169181 $title->getPrefixedText(),
170182 FeedUtils::formatDiff( $obj ),
171 - $obj->rc_this_oldid ? $title->getFullURL( 'diff=' . $obj->rc_this_oldid . '&oldid=prev' ) : $title->getFullURL(),
 183+ $url,
172184 $obj->rc_timestamp,
173185 ($obj->rc_deleted & Revision::DELETED_USER) ? wfMsgHtml('rev-deleted-user') : $obj->rc_user_text,
174186 $talkpage

Status & tagging log