From 58b7b644f91467db1242943d053569580cf387b6 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Mon, 6 Aug 2012 00:08:35 +0200 Subject: [PATCH] change some rc_new to rc_type == RC_NEW The field rc_new is obsolete and should be removed, see bug 34320 Change-Id: I411ec2cb0fe3eb078094eded210d4aefee5f8e74 --- includes/ChangesList.php | 10 +++++----- includes/RecentChange.php | 4 ++-- includes/api/ApiQueryRecentChanges.php | 4 ++-- includes/api/ApiQueryWatchlist.php | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/includes/ChangesList.php b/includes/ChangesList.php index 96a11e1b22..9daf3a9daf 100644 --- a/includes/ChangesList.php +++ b/includes/ChangesList.php @@ -507,7 +507,7 @@ class ChangesList extends ContextSource { * @param $rc RecentChange */ public function insertRollback( &$s, &$rc ) { - if( !$rc->mAttribs['rc_new'] && $rc->mAttribs['rc_this_oldid'] && $rc->mAttribs['rc_cur_id'] ) { + if( $rc->mAttribs['rc_type'] != RC_NEW && $rc->mAttribs['rc_this_oldid'] && $rc->mAttribs['rc_cur_id'] ) { $page = $rc->getTitle(); /** Check for rollback and edit permissions, disallow special pages, and only * show a link on the top-most revision */ @@ -548,7 +548,7 @@ class ChangesList extends ContextSource { if ( !$rc->mAttribs['rc_patrolled'] ) { if ( $this->getUser()->useRCPatrol() ) { $unpatrolled = true; - } elseif ( $this->getUser()->useNPPatrol() && $rc->mAttribs['rc_new'] ) { + } elseif ( $this->getUser()->useNPPatrol() && $rc->mAttribs['rc_type'] == RC_NEW ) { $unpatrolled = true; } } @@ -613,7 +613,7 @@ class OldChangesList extends ChangesList { # M, N, b and ! (minor, new, bot and unpatrolled) $s .= $this->recentChangesFlags( array( - 'newpage' => $rc->mAttribs['rc_new'], + 'newpage' => $rc->mAttribs['rc_type'] == RC_NEW, 'minor' => $rc->mAttribs['rc_minor'], 'unpatrolled' => $unpatrolled, 'bot' => $rc->mAttribs['rc_bot'] @@ -868,7 +868,7 @@ class EnhancedChangesList extends ChangesList { $allLogs = true; foreach( $block as $rcObj ) { $oldid = $rcObj->mAttribs['rc_last_oldid']; - if( $rcObj->mAttribs['rc_new'] ) { + if( $rcObj->mAttribs['rc_type'] == RC_NEW ) { $isnew = true; } // If all log actions to this page were hidden, then don't @@ -1028,7 +1028,7 @@ class EnhancedChangesList extends ChangesList { $r .= ''; $r .= $this->recentChangesFlags( array( - 'newpage' => $rcObj->mAttribs['rc_new'], + 'newpage' => $type == RC_NEW, 'minor' => $rcObj->mAttribs['rc_minor'], 'unpatrolled' => $rcObj->unpatrolled, 'bot' => $rcObj->mAttribs['rc_bot'], diff --git a/includes/RecentChange.php b/includes/RecentChange.php index 4a7bafd900..288dd3eb87 100644 --- a/includes/RecentChange.php +++ b/includes/RecentChange.php @@ -734,10 +734,10 @@ class RecentChange { } else { $comment = self::cleanupForIRC( $this->mAttribs['rc_comment'] ); $flag = ''; - if ( !$this->mAttribs['rc_patrolled'] && ( $wgUseRCPatrol || $this->mAttribs['rc_new'] && $wgUseNPPatrol ) ) { + if ( !$this->mAttribs['rc_patrolled'] && ( $wgUseRCPatrol || $this->mAttribs['rc_type'] == RC_NEW && $wgUseNPPatrol ) ) { $flag .= '!'; } - $flag .= ( $this->mAttribs['rc_new'] ? "N" : "" ) . ( $this->mAttribs['rc_minor'] ? "M" : "" ) . ( $this->mAttribs['rc_bot'] ? "B" : "" ); + $flag .= ( $this->mAttribs['rc_type'] == RC_NEW ? "N" : "" ) . ( $this->mAttribs['rc_minor'] ? "M" : "" ) . ( $this->mAttribs['rc_bot'] ? "B" : "" ); } if ( $wgRC2UDPInterwikiPrefix === true && $wgLocalInterwiki !== false ) { diff --git a/includes/api/ApiQueryRecentChanges.php b/includes/api/ApiQueryRecentChanges.php index 91d371b111..7bb6bc5140 100644 --- a/includes/api/ApiQueryRecentChanges.php +++ b/includes/api/ApiQueryRecentChanges.php @@ -236,7 +236,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { $this->addFieldsIf( 'rc_comment', $this->fld_comment || $this->fld_parsedcomment ); $this->addFieldsIf( 'rc_user', $this->fld_user ); $this->addFieldsIf( 'rc_user_text', $this->fld_user || $this->fld_userid ); - $this->addFieldsIf( array( 'rc_minor', 'rc_new', 'rc_bot' ) , $this->fld_flags ); + $this->addFieldsIf( array( 'rc_minor', 'rc_type', 'rc_bot' ) , $this->fld_flags ); $this->addFieldsIf( array( 'rc_old_len', 'rc_new_len' ), $this->fld_sizes ); $this->addFieldsIf( 'rc_patrolled', $this->fld_patrolled ); $this->addFieldsIf( array( 'rc_logid', 'rc_log_type', 'rc_log_action', 'rc_params' ), $this->fld_loginfo ); @@ -393,7 +393,7 @@ class ApiQueryRecentChanges extends ApiQueryGeneratorBase { if ( $row->rc_bot ) { $vals['bot'] = ''; } - if ( $row->rc_new ) { + if ( $row->rc_type == RC_NEW ) { $vals['new'] = ''; } if ( $row->rc_minor ) { diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 36644a4ade..a1a337281f 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -96,7 +96,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { 'rc_last_oldid', ) ); - $this->addFieldsIf( array( 'rc_new', 'rc_minor', 'rc_bot' ), $this->fld_flags ); + $this->addFieldsIf( array( 'rc_type', 'rc_minor', 'rc_bot' ), $this->fld_flags ); $this->addFieldsIf( 'rc_user', $this->fld_user || $this->fld_userid ); $this->addFieldsIf( 'rc_user_text', $this->fld_user ); $this->addFieldsIf( 'rc_comment', $this->fld_comment || $this->fld_parsedcomment ); @@ -254,7 +254,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { } if ( $this->fld_flags ) { - if ( $row->rc_new ) { + if ( $row->rc_type == RC_NEW ) { $vals['new'] = ''; } if ( $row->rc_minor ) { -- 2.20.1