r81049 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81048‎ | r81049 | r81050 >
Date:20:03, 26 January 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Followup fixme on r80861,

Do cl_from <> 0 check not in SQL, remove order by.

Fixup casing error noticed also
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -3516,18 +3516,23 @@
35173517 public function getParentCategories() {
35183518 global $wgContLang;
35193519
3520 - $titlekey = $this->getArticleId();
 3520+ $data = array();
 3521+
 3522+ $titleKey = $this->getArticleId();
 3523+
 3524+ if ( $titleKey === 0 ) {
 3525+ return $data;
 3526+ }
 3527+
35213528 $dbr = wfGetDB( DB_SLAVE );
35223529
35233530 $res = $dbr->select( 'categorylinks', '*',
35243531 array(
35253532 'cl_from' => $titleKey,
3526 - "cl_from <> '0'",
35273533 ),
35283534 __METHOD__,
3529 - array( 'ORDER BY' => 'cl_sortkey' )
 3535+ array()
35303536 );
3531 - $data = array();
35323537
35333538 if ( $dbr->numRows( $res ) > 0 ) {
35343539 foreach ( $res as $row ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r80861Fixup usage of raw sql in Title...reedy15:30, 24 January 2011

Comments

#Comment by Platonides (talk | contribs)   22:20, 27 January 2011

The === looked suspicious, but turned up to be ok.

Revision seems good.

Status & tagging log