From 7d1e4bef1162a849aeb336558d527946186ef193 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Wed, 26 Jan 2011 20:03:38 +0000 Subject: [PATCH] Followup fixme on r80861, Do cl_from <> 0 check not in SQL, remove order by. Fixup casing error noticed also --- includes/Title.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/includes/Title.php b/includes/Title.php index 421be43fbf..e98ab59176 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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 ) { -- 2.20.1