r82729 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82728‎ | r82729 | r82730 >
Date:16:00, 24 February 2011
Author:reedy
Status:ok
Tags:
Comment:
Followup r82727, improve comments, cast return value to bool
Modified paths:
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/api/ApiBase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Article.php
@@ -2431,6 +2431,9 @@
24322432
24332433 /**
24342434 * Add this page to $wgUser's watchlist
 2435+ *
 2436+ * This is safe to be called multiple times
 2437+ *
24352438 * @return bool true on successful watch operation
24362439 */
24372440 public function doWatch() {
Index: trunk/phase3/includes/api/ApiBase.php
@@ -602,8 +602,8 @@
603603 $userOption = $titleObj->exists()
604604 ? 'watchdefault' : 'watchcreations';
605605 }
606 - # If the corresponding user option is true, watch, don't
607 - return $wgUser->getOption( $userOption ) ? true : false;
 606+ # Watch the article based on the user preference
 607+ return (bool)$wgUser->getOption( $userOption );
608608
609609 case 'nochange':
610610 return $userWatching;

Follow-up revisions

RevisionCommit summaryAuthorDate
r82730MFT r82727, 82729reedy16:03, 24 February 2011
r82731MFT r82727, 82729reedy16:03, 24 February 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r82727Seems the api edit watch/unwatch wasn't too well tested (after it got poked a...reedy15:51, 24 February 2011

Status & tagging log