Index: trunk/phase3/includes/Title.php |
— | — | @@ -3516,18 +3516,23 @@ |
3517 | 3517 | public function getParentCategories() { |
3518 | 3518 | global $wgContLang; |
3519 | 3519 | |
3520 | | - $titlekey = $this->getArticleId(); |
| 3520 | + $data = array(); |
| 3521 | + |
| 3522 | + $titleKey = $this->getArticleId(); |
| 3523 | + |
| 3524 | + if ( $titleKey === 0 ) { |
| 3525 | + return $data; |
| 3526 | + } |
| 3527 | + |
3521 | 3528 | $dbr = wfGetDB( DB_SLAVE ); |
3522 | 3529 | |
3523 | 3530 | $res = $dbr->select( 'categorylinks', '*', |
3524 | 3531 | array( |
3525 | 3532 | 'cl_from' => $titleKey, |
3526 | | - "cl_from <> '0'", |
3527 | 3533 | ), |
3528 | 3534 | __METHOD__, |
3529 | | - array( 'ORDER BY' => 'cl_sortkey' ) |
| 3535 | + array() |
3530 | 3536 | ); |
3531 | | - $data = array(); |
3532 | 3537 | |
3533 | 3538 | if ( $dbr->numRows( $res ) > 0 ) { |
3534 | 3539 | foreach ( $res as $row ) { |