36019: Revert b/25095 breaks Special:Categories
authorsaper <saper@saper.info>
Mon, 16 Apr 2012 17:39:00 +0000 (19:39 +0200)
committersaper <saper@saper.info>
Mon, 16 Apr 2012 17:42:59 +0000 (19:42 +0200)
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
includes/specials/SpecialCategories.php

index 94f034c..c15ebff 100644 (file)
@@ -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]]
index 338cd70..6d2831c 100644 (file)
@@ -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' ),
                );
        }