From 17ebbe492c067231cb5ae67820bac78da6cd1998 Mon Sep 17 00:00:00 2001 From: JuneHyeon Bae Date: Thu, 5 Jun 2014 09:54:02 +0900 Subject: [PATCH] Remove obsolete RC_MOVE and RC_MOVE_OVER_REDIRECT rc types RC_MOVE and RC_MOVE_OVER_REDIRECT are obsolete, since at least 2006. So it is considered safe to remove. Bug: 63755 Change-Id: I0f17c4d164585a48fb9f0d40b90a7d3b975c7ab8 --- RELEASE-NOTES-1.24 | 2 ++ includes/Defines.php | 2 -- includes/changes/ChangesList.php | 12 +++++------- includes/changes/EnhancedChangesList.php | 22 +++++++--------------- includes/changes/OldChangesList.php | 5 +---- includes/changes/RCCacheEntryFactory.php | 11 ++++------- includes/changes/RecentChange.php | 6 ------ 7 files changed, 19 insertions(+), 41 deletions(-) diff --git a/RELEASE-NOTES-1.24 b/RELEASE-NOTES-1.24 index b15ef6d071..deeb6b83f5 100644 --- a/RELEASE-NOTES-1.24 +++ b/RELEASE-NOTES-1.24 @@ -135,6 +135,8 @@ changes to languages because of Bugzilla reports. * (bug 63891) Add 'X-Robots-Tag: noindex' header in action=render pages. * SpecialPage no longer supports the syntax for invoking wfSpecial*() functions. All special pages should subclass SpecialPage and implement the execute() method. +* (bug 63755) The deprecated constants RC_MOVE and RC_MOVE_OVER_REDIRECT were + removed. ==== Renamed classes ==== * CLDRPluralRuleConverter_Expression to CLDRPluralRuleConverterExpression diff --git a/includes/Defines.php b/includes/Defines.php index 19801ec0e9..ce4ede3aeb 100644 --- a/includes/Defines.php +++ b/includes/Defines.php @@ -177,9 +177,7 @@ define( 'MW_DATE_ISO', 'ISO 8601' ); */ define( 'RC_EDIT', 0 ); define( 'RC_NEW', 1 ); -define( 'RC_MOVE', 2 ); // obsolete define( 'RC_LOG', 3 ); -define( 'RC_MOVE_OVER_REDIRECT', 4 ); // obsolete define( 'RC_EXTERNAL', 5 ); /**@}*/ diff --git a/includes/changes/ChangesList.php b/includes/changes/ChangesList.php index 246f95d211..cd43f82934 100644 --- a/includes/changes/ChangesList.php +++ b/includes/changes/ChangesList.php @@ -432,13 +432,11 @@ class ChangesList extends ContextSource { * @return string */ public function insertComment( $rc ) { - if ( $rc->mAttribs['rc_type'] != RC_MOVE && $rc->mAttribs['rc_type'] != RC_MOVE_OVER_REDIRECT ) { - if ( $this->isDeleted( $rc, Revision::DELETED_COMMENT ) ) { - return ' ' . - $this->msg( 'rev-deleted-comment' )->escaped() . ''; - } else { - return Linker::commentBlock( $rc->mAttribs['rc_comment'], $rc->getTitle() ); - } + if ( $this->isDeleted( $rc, Revision::DELETED_COMMENT ) ) { + return ' ' . + $this->msg( 'rev-deleted-comment' )->escaped() . ''; + } else { + return Linker::commentBlock( $rc->mAttribs['rc_comment'], $rc->getTitle() ); } return ''; diff --git a/includes/changes/EnhancedChangesList.php b/includes/changes/EnhancedChangesList.php index 7307c699cb..0c073c6a0b 100644 --- a/includes/changes/EnhancedChangesList.php +++ b/includes/changes/EnhancedChangesList.php @@ -143,11 +143,7 @@ class EnhancedChangesList extends ChangesList { $type = $cacheEntry->mAttribs['rc_type']; - // @todo remove handling for RC_MOVE and RC_MOVE_OVER_REDIRECT (bug 63755) - if ( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) { - // Use an # character to prevent collision with page names - $cacheGroupingKey = '##' . ( $this->rcMoveIndex++ ); - } elseif ( $type == RC_LOG ) { + if ( $type == RC_LOG ) { // Group by log type $cacheGroupingKey = SpecialPage::getTitleFor( 'Log', @@ -551,16 +547,12 @@ class EnhancedChangesList extends ChangesList { $r .= ''; # Flag and Timestamp - if ( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) { - $r .= $this->recentChangesFlags( array() ); // no flags, but need the placeholders - } else { - $r .= $this->recentChangesFlags( array( - 'newpage' => $type == RC_NEW, - 'minor' => $rcObj->mAttribs['rc_minor'], - 'unpatrolled' => $rcObj->unpatrolled, - 'bot' => $rcObj->mAttribs['rc_bot'], - ) ); - } + $r .= $this->recentChangesFlags( array( + 'newpage' => $type == RC_NEW, + 'minor' => $rcObj->mAttribs['rc_minor'], + 'unpatrolled' => $rcObj->unpatrolled, + 'bot' => $rcObj->mAttribs['rc_bot'], + ) ); $r .= ' ' . $rcObj->timestamp . ' '; # Article or log link if ( $logType ) { diff --git a/includes/changes/OldChangesList.php b/includes/changes/OldChangesList.php index 458f21a139..d590ff6472 100644 --- a/includes/changes/OldChangesList.php +++ b/includes/changes/OldChangesList.php @@ -53,10 +53,7 @@ class OldChangesList extends ChangesList { $classes[] = $watched && $rc->mAttribs['rc_timestamp'] >= $watched ? 'mw-changeslist-line-watched' : 'mw-changeslist-line-not-watched'; - // Moved pages (very very old, not supported anymore) - if ( $rc->mAttribs['rc_type'] == RC_MOVE || $rc->mAttribs['rc_type'] == RC_MOVE_OVER_REDIRECT ) { - // Log entries - } elseif ( $rc->mAttribs['rc_log_type'] ) { + if ( $rc->mAttribs['rc_log_type'] ) { $logtitle = SpecialPage::getTitleFor( 'Log', $rc->mAttribs['rc_log_type'] ); $this->insertLog( $s, $logtitle, $rc->mAttribs['rc_log_type'] ); // Log entries (old format) or log targets, and special pages diff --git a/includes/changes/RCCacheEntryFactory.php b/includes/changes/RCCacheEntryFactory.php index 25a572bdec..c3fe183e1f 100644 --- a/includes/changes/RCCacheEntryFactory.php +++ b/includes/changes/RCCacheEntryFactory.php @@ -97,11 +97,8 @@ class RCCacheEntryFactory { private function buildCLink( RecentChange $cacheEntry ) { $type = $cacheEntry->mAttribs['rc_type']; - // Page moves, very old style, not supported anymore - if ( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) { - $clink = ''; // New unpatrolled pages - } elseif ( $cacheEntry->unpatrolled && $type == RC_NEW ) { + if ( $cacheEntry->unpatrolled && $type == RC_NEW ) { $clink = Linker::linkKnown( $cacheEntry->getTitle() ); // Log entries } elseif ( $type == RC_LOG ) { @@ -171,7 +168,7 @@ class RCCacheEntryFactory { private function buildCurLink( RecentChange $cacheEntry, $showDiffLinks, $counter ) { $queryParams = $this->buildCurQueryParams( $cacheEntry ); $curMessage = $this->getMessage( 'cur' ); - $logTypes = array( RC_LOG, RC_MOVE, RC_MOVE_OVER_REDIRECT ); + $logTypes = array( RC_LOG ); if ( !$showDiffLinks || in_array( $cacheEntry->mAttribs['rc_type'], $logTypes ) ) { $curLink = $curMessage; @@ -206,7 +203,7 @@ class RCCacheEntryFactory { private function buildDiffLink( RecentChange $cacheEntry, $showDiffLinks, $counter ) { $queryParams = $this->buildDiffQueryParams( $cacheEntry ); $diffMessage = $this->getMessage( 'diff' ); - $logTypes = array( RC_NEW, RC_LOG, RC_MOVE, RC_MOVE_OVER_REDIRECT ); + $logTypes = array( RC_NEW, RC_LOG ); if ( !$showDiffLinks ) { $diffLink = $diffMessage; @@ -230,7 +227,7 @@ class RCCacheEntryFactory { $lastOldid = $cacheEntry->mAttribs['rc_last_oldid']; $lastMessage = $this->getMessage( 'last' ); $type = $cacheEntry->mAttribs['rc_type']; - $logTypes = array( RC_LOG, RC_MOVE, RC_MOVE_OVER_REDIRECT ); + $logTypes = array( RC_LOG ); // Make "last" link if ( !$showDiffLinks || !$lastOldid || in_array( $type, $logTypes ) ) { diff --git a/includes/changes/RecentChange.php b/includes/changes/RecentChange.php index 60aba7ebd7..8fa6ed9f07 100644 --- a/includes/changes/RecentChange.php +++ b/includes/changes/RecentChange.php @@ -147,18 +147,12 @@ class RecentChange { case RC_NEW: $type = 'new'; break; - case RC_MOVE: // obsolete - $type = 'move'; - break; case RC_LOG: $type = 'log'; break; case RC_EXTERNAL: $type = 'external'; break; - case RC_MOVE_OVER_REDIRECT: // obsolete - $type = 'move over redirect'; - break; default: $type = "$rcType"; } -- 2.20.1