Merge "In LinkHolderArray::doVariants(), redlinks need to be checked as well."
[lhc/web/wiklou.git] / includes / api / ApiQueryAllCategories.php
index b0f272b..a2fb5c3 100644 (file)
@@ -57,6 +57,7 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase {
 
                $this->addTables( 'category' );
                $this->addFields( 'cat_title' );
+               $this->addWhere( 'cat_pages > 0' );
 
                $dir = ( $params['dir'] == 'descending' ? 'older' : 'newer' );
                $from = ( is_null( $params['from'] ) ? null : $this->titlePartToKey( $params['from'] ) );
@@ -112,7 +113,7 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase {
                        // Normalize titles
                        $titleObj = Title::makeTitle( NS_CATEGORY, $row->cat_title );
                        if ( !is_null( $resultPageSet ) ) {
-                               $pages[] = $titleObj->getPrefixedText();
+                               $pages[] = $titleObj;
                        } else {
                                $item = array();
                                $result->setContent( $item, $titleObj->getText() );
@@ -192,6 +193,23 @@ class ApiQueryAllCategories extends ApiQueryGeneratorBase {
                );
        }
 
+       public function getResultProperties() {
+               return array(
+                       '' => array(
+                               '*' => 'string'
+                       ),
+                       'size' => array(
+                               'size' => 'integer',
+                               'pages' => 'integer',
+                               'files' => 'integer',
+                               'subcats' => 'integer'
+                       ),
+                       'hidden' => array(
+                               'hidden' => 'boolean'
+                       )
+               );
+       }
+
        public function getDescription() {
                return 'Enumerate all categories';
        }