From 3d855c142aaee7923798b5274b591fd0ee643399 Mon Sep 17 00:00:00 2001 From: saper Date: Mon, 16 Apr 2012 19:39:00 +0200 Subject: [PATCH] 36019: Revert b/25095 breaks Special:Categories bug 25095: Special:Categories doesn't show first relevant item when "from" is filled" bug 36019: Special:Categories does not keep "from" parameter between list size changes This reverts commit 1a5edfa6c0584e2cdc8310f302962fd8daea31eb. This commit broke behaviour of CategoryPager inherited fromAlphabeticPager. This was actually pointed out: * https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113415#c32002 This needs to go into 1.19 as well. Conflicts: RELEASE-NOTES-1.19 Change-Id: I119160d59c4fca0d069adef60151b30d53b582a1 --- RELEASE-NOTES-1.19 | 2 -- includes/specials/SpecialCategories.php | 8 ++------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 94f034c4b5..c15ebffd78 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -291,8 +291,6 @@ production. array. * (bug 29753) mw.util.tooltipAccessKeyPrefix should be alt-shift for Chrome on Windows -* (bug 25095) Special:Categories should also include the first relevant item - when "from" is filled. * (bug 12262) Indents and lists are now aligned * (bug 34972) An error occurred while changing your watchlist settings for [[Special:WhatLinksHere/Example]] diff --git a/includes/specials/SpecialCategories.php b/includes/specials/SpecialCategories.php index 338cd70666..6d2831c7b0 100644 --- a/includes/specials/SpecialCategories.php +++ b/includes/specials/SpecialCategories.php @@ -59,16 +59,12 @@ class SpecialCategories extends SpecialPage { * @ingroup SpecialPage Pager */ class CategoryPager extends AlphabeticPager { - private $conds = array( 'cat_pages > 0' ); - function __construct( IContextSource $context, $from ) { parent::__construct( $context ); $from = str_replace( ' ', '_', $from ); if( $from !== '' ) { $from = Title::capitalize( $from, NS_CATEGORY ); - $dbr = wfGetDB( DB_SLAVE ); - $this->conds[] = 'cat_title >= ' . $dbr->addQuotes( $from ); - $this->setOffset( '' ); + $this->mOffset = $from; } } @@ -76,7 +72,7 @@ class CategoryPager extends AlphabeticPager { return array( 'tables' => array( 'category' ), 'fields' => array( 'cat_title','cat_pages' ), - 'conds' => $this->conds, + 'conds' => array( 'cat_pages > 0' ), 'options' => array( 'USE INDEX' => 'cat_title' ), ); } -- 2.20.1