r78051 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78050‎ | r78051 | r78052 >
Date:07:31, 8 December 2010
Author:aaron
Status:ok
Tags:
Comment:
*(bug 15515) Fixed addToContribsLine() and addDraftTab() query w.r.t page imports
*Viewing oldid=X, where X is the stable rev, no longer highlights "pending changes" tab...except for the pending templates/files case
*Renamed isCurrent() -> revIsCurrent()
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticle.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevision.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/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: trunk/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: trunk/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: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -1185,10 +1185,20 @@
11861186 // We are looking a the stable version or an old reviewed one
11871187 $tabs['read']['class'] = 'selected';
11881188 } elseif ( self::isViewAction( $action ) ) {
1189 - // Are we looking at a draft/current revision?
1190 - // Note: there may *just* be template/file changes.
1191 - if ( $wgOut->getRevisionId() >= $srev->getRevId() ) {
 1189+ $ts = null;
 1190+ if ( $wgOut->getRevisionId() ) { // @TODO: avoid same query in Skin.php
 1191+ $ts = ( $wgOut->getRevisionId() == $this->article->getLatest() )
 1192+ ? $this->article->getTimestamp() // skip query
 1193+ : Revision::getTimestampFromId( $title, $wgOut->getRevisionId() );
 1194+ }
 1195+ // Are we looking at a pending revision?
 1196+ if ( $ts > $srev->getRevTimestamp() ) { // bug 15515
11921197 $tabs['draft']['class'] .= ' selected';
 1198+ // Are there *just* pending template/file changes.
 1199+ } elseif ( $this->article->onlyTemplatesOrFilesPending()
 1200+ && $wgOut->getRevisionId() == $this->article->getStable() )
 1201+ {
 1202+ $tabs['draft']['class'] .= ' selected';
11931203 // Otherwise, fallback to regular tab behavior
11941204 } else {
11951205 $tabs['read']['class'] = 'selected';

Follow-up revisions

RevisionCommit summaryAuthorDate
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
r78650Merged r78051 from trunk ( bug 15515 )pdhanda23:30, 20 December 2010
r78651Merged r78092 from trunk ( bug 15515 )pdhanda23:32, 20 December 2010
r78729Merged r78166 from trunk (bug 15515)pdhanda19:57, 21 December 2010
r80733MFT first round of FlaggedRevs fixes r78517, r78346, r78319, r78293, r78226, ...demon23:56, 21 January 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r78044* (bug 15515) Fixed history highlighting and getPendingRevCount() to handle t...aaron05:17, 8 December 2010

Status & tagging log