r78650 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78649‎ | r78650 | r78651 >
Date:23:30, 20 December 2010
Author:pdhanda
Status:ok
Tags:
Comment:
Merged r78051 from trunk ( bug 15515 )
Modified paths:
  • /branches/priyanka-wmf-fixes/extensions/FlaggedRevs/FlaggedArticle.php (modified) (history)
  • /branches/priyanka-wmf-fixes/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)
  • /branches/priyanka-wmf-fixes/extensions/FlaggedRevs/FlaggedRevision.php (modified) (history)
  • /branches/priyanka-wmf-fixes/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)

Diff [purge]

Index: branches/priyanka-wmf-fixes/extensions/FlaggedRevs/FlaggedArticle.php
@@ -215,6 +215,14 @@
216216 }
217217
218218 /**
 219+ * Are template/file changes and ONLY template/file changes pending?
 220+ * @return bool
 221+ */
 222+ public function onlyTemplatesOrFilesPending() {
 223+ return ( !$this->revsArePending() && !$this->stableVersionIsSynced() );
 224+ }
 225+
 226+ /**
219227 * Is this page less open than the site defaults?
220228 * @return bool
221229 */
Index: branches/priyanka-wmf-fixes/extensions/FlaggedRevs/FlaggedRevision.php
@@ -391,7 +391,7 @@
392392 * Note: here for convenience
393393 * @return bool
394394 */
395 - public function isCurrent() {
 395+ public function revIsCurrent() {
396396 $rev = $this->getRevision(); // corresponding revision
397397 return ( $rev ? $rev->isCurrent() : false );
398398 }
Index: branches/priyanka-wmf-fixes/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -1608,6 +1608,7 @@
16091609 # Highlight unchecked content
16101610 $queryInfo['tables'][] = 'flaggedpages';
16111611 $queryInfo['fields'][] = 'fp_stable';
 1612+ $queryInfo['fields'][] = 'fp_pending_since';
16121613 $queryInfo['join_conds']['flaggedpages'] = array( 'LEFT JOIN', "fp_page_id = rev_page" );
16131614 return true;
16141615 }
@@ -1744,7 +1745,9 @@
17451746 } elseif ( isset( $row->fr_quality ) ) {
17461747 $ret = '<span class="' . FlaggedRevsXML::getQualityColor( $row->fr_quality ) .
17471748 '">' . $ret . '</span>';
1748 - } elseif ( isset( $row->fp_stable ) && $row->rev_id > $row->fp_stable ) {
 1749+ } elseif ( isset( $row->fp_pending_since )
 1750+ && $row->rev_timestamp >= $row->fp_pending_since ) // bug 15515
 1751+ {
17491752 $ret = '<span class="flaggedrevs-pending">' . $ret . '</span>';
17501753 } elseif ( !isset( $row->fp_stable ) ) {
17511754 $ret = '<span class="flaggedrevs-unreviewed">' . $ret . '</span>';
Index: branches/priyanka-wmf-fixes/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -1188,10 +1188,20 @@
11891189 // We are looking a the stable version or an old reviewed one
11901190 $tabs['read']['class'] = 'selected';
11911191 } elseif ( self::isViewAction( $action ) ) {
1192 - // Are we looking at a draft/current revision?
1193 - // Note: there may *just* be template/file changes.
1194 - if ( $wgOut->getRevisionId() >= $srev->getRevId() ) {
 1192+ $ts = null;
 1193+ if ( $wgOut->getRevisionId() ) { // @TODO: avoid same query in Skin.php
 1194+ $ts = ( $wgOut->getRevisionId() == $this->article->getLatest() )
 1195+ ? $this->article->getTimestamp() // skip query
 1196+ : Revision::getTimestampFromId( $title, $wgOut->getRevisionId() );
 1197+ }
 1198+ // Are we looking at a pending revision?
 1199+ if ( $ts > $srev->getRevTimestamp() ) { // bug 15515
11951200 $tabs['draft']['class'] .= ' selected';
 1201+ // Are there *just* pending template/file changes.
 1202+ } elseif ( $this->article->onlyTemplatesOrFilesPending()
 1203+ && $wgOut->getRevisionId() == $this->article->getStable() )
 1204+ {
 1205+ $tabs['draft']['class'] .= ' selected';
11961206 // Otherwise, fallback to regular tab behavior
11971207 } else {
11981208 $tabs['read']['class'] = 'selected';

Follow-up revisions

RevisionCommit summaryAuthorDate
r78651Merged r78092 from trunk ( bug 15515 )pdhanda23:32, 20 December 2010
r78729Merged r78166 from trunk (bug 15515)pdhanda19:57, 21 December 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r78044* (bug 15515) Fixed history highlighting and getPendingRevCount() to handle t...aaron05:17, 8 December 2010
r78051*(bug 15515) Fixed addToContribsLine() and addDraftTab() query w.r.t page imp...aaron07:31, 8 December 2010
r78092Improved getDiffRevMsgAndClass() for bug 15515aaron19:42, 8 December 2010
r78140* Made addToRCQuery() more selective for RCL. The RC hook should really requi...aaron21:28, 9 December 2010
r78557*Made 'excludeLastDays' act on 'totalContentEdits'/'totalCheckedEdits' too...aaron06:03, 18 December 2010
r78649Merged r78044 from trunk ( bug 15515 )pdhanda23:29, 20 December 2010

Status & tagging log