https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113415

Revision: 113415
Author:   maxsem
Date:     2012-03-08 22:51:39 +0000 (Thu, 08 Mar 2012)
Log Message:
-----------
(bug 25095) Special:Categories doesn't show first relevant item when "from" is 
filled

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES-1.19
    trunk/phase3/includes/specials/SpecialCategories.php

Modified: trunk/phase3/RELEASE-NOTES-1.19
===================================================================
--- trunk/phase3/RELEASE-NOTES-1.19     2012-03-08 22:37:38 UTC (rev 113414)
+++ trunk/phase3/RELEASE-NOTES-1.19     2012-03-08 22:51:39 UTC (rev 113415)
@@ -266,6 +266,7 @@
 * (bug 34604) [mw.config] wgActionPaths should be an object instead of a 
numeral
   array.
 * (bug 29753) mw.util.tooltipAccessKeyPrefix should be alt-shift for Chrome on 
Windows
+* (bug 25095) Special:Categories doesn't show first relevant item when "from" 
is filled.
 
 === API changes in 1.19 ===
 * Made action=edit less likely to return "unknownerror", by returning the 
actual error

Modified: trunk/phase3/includes/specials/SpecialCategories.php
===================================================================
--- trunk/phase3/includes/specials/SpecialCategories.php        2012-03-08 
22:37:38 UTC (rev 113414)
+++ trunk/phase3/includes/specials/SpecialCategories.php        2012-03-08 
22:51:39 UTC (rev 113415)
@@ -59,12 +59,16 @@
  * @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 );
-                       $this->mOffset = $from;
+                       $dbr = wfGetDB( DB_SLAVE );
+                       $this->conds[] = 'cat_title >= ' . $dbr->addQuotes( 
$from );
+                       $this->setOffset( '' );
                }
        }
 
@@ -72,7 +76,7 @@
                return array(
                        'tables' => array( 'category' ),
                        'fields' => array( 'cat_title','cat_pages' ),
-                       'conds' => array( 'cat_pages > 0' ),
+                       'conds' => $this->conds,
                        'options' => array( 'USE INDEX' => 'cat_title' ),
                );
        }


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to