CategoryPage bug fix
authorTim Starling <tstarling@users.mediawiki.org>
Fri, 25 Aug 2006 07:33:55 +0000 (07:33 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Fri, 25 Aug 2006 07:33:55 +0000 (07:33 +0000)
includes/AutoLoader.php
includes/CategoryPage.php

index fb6dcea..63ac24b 100644 (file)
@@ -22,6 +22,7 @@ function __autoload($className) {
                'Block' => 'includes/Block.php',
                'CacheManager' => 'includes/CacheManager.php',
                'CategoryPage' => 'includes/CategoryPage.php',
+               'CategoryViewer' => 'includes/CategoryPage.php',
                'Categoryfinder' => 'includes/Categoryfinder.php',
                'RCCacheEntry' => 'includes/ChangesList.php',
                'ChangesList' => 'includes/ChangesList.php',
index f00bc5c..a47017f 100644 (file)
@@ -52,7 +52,7 @@ class CategoryViewer {
                $showGallery, $gallery,
                $skin;
 
-       function __construct( $title, $from, $until ) {
+       function __construct( $title, $from = '', $until = '' ) {
                global $wgCategoryPagingLimit;
                $this->title = $title;
                $this->from = $from;
@@ -120,13 +120,12 @@ class CategoryViewer {
                // entry in the categorylinks table is Category:A, not A, which it SHOULD be.
                // Workaround: If sortkey == "Category:".$title, than use $title for sorting,
                // else use sortkey...
-               $sortkey = '';
                if( $title->getPrefixedText() == $sortkey ) {
-                       $sortkey = $wgContLang->firstChar( $title->getDBkey() );
+                       $firstChar = $wgContLang->firstChar( $title->getDBkey() );
                } else {
-                       $sortkey = $wgContLang->firstChar( $sortkey );
+                       $firstChar = $wgContLang->firstChar( $sortkey );
                }
-               $this->children_start_char[] = $wgContLang->convert( $sortkey );
+               $this->children_start_char[] = $wgContLang->convert( $firstChar );
        }
 
        /**