r77012 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77011‎ | r77012 | r77013 >
Date:10:53, 19 November 2010
Author:ialex
Status:ok (Comments)
Tags:
Comment:
* (bug 25987) prop=info&inprop=watched now also works for missing pages
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryInfo.php
@@ -593,29 +593,27 @@
594594 private function getWatchedInfo() {
595595 global $wgUser;
596596
597 - if ( $wgUser->isAnon() || count( $this->titles ) == 0 ) {
 597+ if ( $wgUser->isAnon() || count( $this->everything ) == 0 ) {
598598 return;
599599 }
600600
601601 $this->watched = array();
602602 $db = $this->getDB();
603603
604 - $lb = new LinkBatch( $this->titles );
 604+ $lb = new LinkBatch( $this->everything );
605605
606606 $this->resetQueryParams();
607 - $this->addTables( array( 'page', 'watchlist' ) );
608 - $this->addFields( array( 'page_title', 'page_namespace' ) );
 607+ $this->addTables( array( 'watchlist' ) );
 608+ $this->addFields( array( 'wl_title', 'wl_namespace' ) );
609609 $this->addWhere( array(
610 - $lb->constructSet( 'page', $db ),
611 - 'wl_namespace=page_namespace',
612 - 'wl_title=page_title',
 610+ $lb->constructSet( 'wl', $db ),
613611 'wl_user' => $wgUser->getID()
614612 ) );
615613
616614 $res = $this->select( __METHOD__ );
617615
618616 foreach ( $res as $row ) {
619 - $this->watched[$row->page_namespace][$row->page_title] = true;
 617+ $this->watched[$row->wl_namespace][$row->wl_title] = true;
620618 }
621619 }
622620
Index: trunk/phase3/RELEASE-NOTES
@@ -522,6 +522,7 @@
523523 * (bug 25741) Add more data to list=search's srprop
524524 * (bug 25760) counter property still reported by the API when
525525 $wgDisableCounters enabled
 526+* (bug 25987) prop=info&inprop=watched now also works for missing pages
526527
527528 === Languages updated in 1.17 ===
528529

Comments

#Comment by Bryan (talk | contribs)   14:09, 27 November 2010

The page join was unnecessary from the beginning.

#Comment by Catrope (talk | contribs)   17:12, 2 December 2010

Yeah I have no idea what I was thinking when I wrote that. Maybe there was some other property in there that got removed later, or something.

Status & tagging log