Followup fixme on r80861,
authorSam Reed <reedy@users.mediawiki.org>
Wed, 26 Jan 2011 20:03:38 +0000 (20:03 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Wed, 26 Jan 2011 20:03:38 +0000 (20:03 +0000)
Do cl_from <> 0 check not in SQL, remove order by.

Fixup casing error noticed also

includes/Title.php

index 421be43..e98ab59 100644 (file)
@@ -3516,18 +3516,23 @@ class Title {
        public function getParentCategories() {
                global $wgContLang;
 
-               $titlekey = $this->getArticleId();
+               $data = array();
+
+               $titleKey = $this->getArticleId();
+
+               if ( $titleKey === 0 ) {
+                       return $data;
+               }
+
                $dbr = wfGetDB( DB_SLAVE );
 
                $res = $dbr->select( 'categorylinks', '*',
                        array(
                                'cl_from' => $titleKey,
-                               "cl_from <> '0'",
                        ),
                        __METHOD__,
-                       array( 'ORDER BY' => 'cl_sortkey' )
+                       array()
                );
-               $data = array();
 
                if ( $dbr->numRows( $res ) > 0 ) {
                        foreach ( $res as $row ) {