From 91145783c6e148e3c8dd12751b4bdacdbd67b871 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Thu, 25 Aug 2011 17:35:07 +0000 Subject: [PATCH] Revert r8811 Reverting followups r88117, 88252 --- includes/specials/SpecialContributions.php | 42 +++++++++------------- languages/messages/MessagesEn.php | 1 + maintenance/language/messages.inc | 1 - 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 7158faceb3..9f9e0a27d2 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -69,7 +69,6 @@ class SpecialContributions extends SpecialPage { $this->opts['limit'] = $wgRequest->getInt( 'limit', $wgUser->getOption('rclimit') ); $this->opts['target'] = $target; $this->opts['topOnly'] = $wgRequest->getBool( 'topOnly' ); - $this->opts['showSizeDiff'] = $wgRequest->getBool( 'showSizeDiff' ); $nt = Title::makeTitleSafe( NS_USER, $target ); if( !$nt ) { @@ -166,7 +165,6 @@ class SpecialContributions extends SpecialPage { 'month' => $this->opts['month'], 'deletedOnly' => $this->opts['deletedOnly'], 'topOnly' => $this->opts['topOnly'], - 'showSizeDiff' => $this->opts['showSizeDiff'], ) ); if( !$pager->getNumRows() ) { $wgOut->addWikiMsg( 'nocontribs', $target ); @@ -379,14 +377,10 @@ class SpecialContributions extends SpecialPage { $this->opts['topOnly'] = false; } - if( !isset( $this->opts['showSizeDiff'] ) ) { - $this->opts['showSizeDiff'] = !$wgMiserMode; - } - $f = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'class' => 'mw-contributions-form' ) ); # Add hidden params for tracking except for parameters in $skipParameters - $skipParameters = array( 'namespace', 'deletedOnly', 'target', 'contribs', 'year', 'month', 'topOnly', 'showSizeDiff' ); + $skipParameters = array( 'namespace', 'deletedOnly', 'target', 'contribs', 'year', 'month', 'topOnly' ); foreach ( $this->opts as $name => $value ) { if( in_array( $name, $skipParameters ) ) { continue; @@ -397,13 +391,10 @@ class SpecialContributions extends SpecialPage { $tagFilter = ChangeTags::buildTagFilterSelector( $this->opts['tagFilter'] ); $fNS = ''; - $fShowDiff = ''; if ( !$wgMiserMode ) { $fNS = Html::rawElement( 'span', array( 'style' => 'white-space: nowrap' ), - Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' . - Xml::namespaceSelector( $this->opts['namespace'], '' ) - ); - $fShowDiff = Xml::checkLabel( wfMsg( 'sp-contributions-showsizediff' ), 'showSizeDiff', 'mw-show-size-diff', $this->opts['showSizeDiff'] ); + Xml::label( wfMsg( 'namespace' ), 'namespace' ) . ' ' . Xml::namespaceSelector( $this->opts['namespace'], '' ) + ); } $f .= Xml::fieldset( wfMsg( 'sp-contributions-search' ) ) . @@ -420,7 +411,6 @@ class SpecialContributions extends SpecialPage { 'deletedOnly', 'mw-show-deleted-only', $this->opts['deletedOnly'] ) . '
' . Xml::tags( 'p', null, Xml::checkLabel( wfMsg( 'sp-contributions-toponly' ), 'topOnly', 'mw-show-top-only', $this->opts['topOnly'] ) ) . - $fShowDiff. ( $tagFilter ? Xml::tags( 'p', null, implode( ' ', $tagFilter ) ) : '' ) . Html::rawElement( 'p', array( 'style' => 'white-space: nowrap' ), Xml::dateMenu( $this->opts['year'], $this->opts['month'] ) . ' ' . @@ -461,7 +451,6 @@ class ContribsPager extends ReverseChronologicalPager { $this->deletedOnly = !empty( $options['deletedOnly'] ); $this->topOnly = !empty( $options['topOnly'] ); - $this->showSizeDiff = !empty( $options['showSizeDiff'] ); $year = isset( $options['year'] ) ? $options['year'] : false; $month = isset( $options['month'] ) ? $options['month'] : false; @@ -481,7 +470,7 @@ class ContribsPager extends ReverseChronologicalPager { } function getQueryInfo() { - global $wgUser, $wgMiserMode; + global $wgUser; list( $tables, $index, $userCond, $join_cond ) = $this->getUserCond(); $conds = array_merge( $userCond, $this->getNamespaceCond() ); @@ -497,18 +486,17 @@ class ContribsPager extends ReverseChronologicalPager { $fields = array( 'page_namespace', 'page_title', 'page_is_new', 'page_latest', 'page_is_redirect', 'page_len','rev_id', 'rev_page', 'rev_text_id', 'rev_timestamp', 'rev_comment', - 'rev_minor_edit', 'rev_user', 'rev_user_text', 'rev_parent_id', 'rev_deleted', - 'rev_len' + 'rev_minor_edit', 'rev_user', 'rev_user_text', 'rev_parent_id', 'rev_deleted' ); - if ( $this->showSizeDiff && !$wgMiserMode ) { - $fields = array_merge( $fields, array( 'rc_old_len', 'rc_new_len' ) ); - array_unshift( $tables, 'recentchanges' ); - $join_cond['recentchanges'] = array( 'INNER JOIN', "rev_id = rc_this_oldid" ); - } $queryInfo = array( 'tables' => $tables, - 'fields' => $fields, + 'fields' => array( + 'page_namespace', 'page_title', 'page_is_new', 'page_latest', 'page_is_redirect', + 'page_len','rev_id', 'rev_page', 'rev_text_id', 'rev_timestamp', 'rev_comment', + 'rev_minor_edit', 'rev_user', 'rev_user_text', 'rev_parent_id', 'rev_deleted', + 'rc_old_len', 'rc_new_len' + ), 'conds' => $conds, 'options' => array( 'USE INDEX' => array('revision' => $index) ), 'join_conds' => $join_cond @@ -531,16 +519,18 @@ class ContribsPager extends ReverseChronologicalPager { $join_conds = array(); if( $this->target == 'newbies' ) { - $tables = array( 'user_groups', 'page', 'revision' ); + $tables = array( 'recentchanges', 'user_groups', 'page', 'revision' ); $max = $this->mDb->selectField( 'user', 'max(user_id)', false, __METHOD__ ); $condition[] = 'rev_user >' . (int)($max - $max / 100); $condition[] = 'ug_group IS NULL'; $index = 'user_timestamp'; # @todo FIXME: Other groups may have 'bot' rights $join_conds['user_groups'] = array( 'LEFT JOIN', "ug_user = rev_user AND ug_group = 'bot'" ); + $join_conds['recentchanges'] = array( 'INNER JOIN', "rev_id = rc_this_oldid" ); } else { - $tables = array( 'page', 'revision' ); + $tables = array( 'recentchanges', 'page', 'revision' ); $condition['rev_user_text'] = $this->target; + $join_conds['recentchanges'] = array( 'INNER JOIN', "rev_id = rc_this_oldid" ); $index = 'usertext_timestamp'; } if( $this->deletedOnly ) { @@ -689,7 +679,7 @@ class ContribsPager extends ReverseChronologicalPager { $diffOut = ' . . ' . $wgLang->getDirMark() . ( $this->showSizeDiff ? - ChangesList::showCharacterDifference( $row->rc_old_len, $row->rc_new_len ) : Linker::formatRevisionSize( $row->rev_len ) ); + ChangesList::showCharacterDifference( $row->rc_old_len, $row->rc_new_len ) : '' ); $ret = "{$del}{$d} {$diffHistLinks} {$nflag}{$mflag} {$link}{$diffOut}{$userlink} {$comment} {$topmarktext}"; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 5ea6ff27af..3b57fd35b7 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -3007,6 +3007,7 @@ The latest block log entry is provided below for reference:', 'sp-contributions-footer' => '-', # do not translate or duplicate this message to other languages 'sp-contributions-footer-anon' => '-', # do not translate or duplicate this message to other languages 'sp-contributions-showsizediff' => 'Display difference in page size', +'sp-contributions-showsizediff-warn' => 'This instance has recent changes log limited to $1 . If you use this option, pages not in this log will not be displayed', # What links here 'whatlinkshere' => 'What links here', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index ebeac684c2..35cb63db4f 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -2033,7 +2033,6 @@ $wgMessageStructure = array( 'sp-contributions-explain', 'sp-contributions-footer', 'sp-contributions-footer-anon', - 'sp-contributions-showsizediff', ), 'whatlinkshere' => array( 'whatlinkshere', -- 2.20.1