From d840fbbc953189abf66f8b3ad3b544f8064dc3c9 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Mon, 12 Apr 2010 10:44:45 +0000 Subject: [PATCH] Revert r64955 Again partial fix to bug 23167 Bugfix watch on creation (edit and upload), in current form, setting unwatch, or nochange would follow watchcreation, which wasn't requested --- includes/api/ApiBase.php | 13 ++++++++----- includes/api/ApiEditPage.php | 2 +- includes/api/ApiUpload.php | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 5f2a185d9a..b90b0be28f 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -551,11 +551,14 @@ abstract class ApiBase { case 'preferences': global $wgUser; - if ( isset($titleObj) - && $titleObj->exists() - && $wgUser->getOption( 'watchdefault' ) - && !$titleObj->userIsWatching() ) { - return true; + if ( isset($titleObj) && !$titleObj->userIsWatching() ) { + if ( $titleObj->exists() ) { + if ( $wgUser->getOption( 'watchdefault' ) ) { + return true; + } + } elseif ( $wgUser->getOption( 'watchcreations' ) ) { + return true; + } } return null; diff --git a/includes/api/ApiEditPage.php b/includes/api/ApiEditPage.php index 77377b0573..02eca54988 100644 --- a/includes/api/ApiEditPage.php +++ b/includes/api/ApiEditPage.php @@ -202,7 +202,7 @@ class ApiEditPage extends ApiBase { $reqArr['wpSection'] = ''; } - $watch = $this->getWatchlistValue( $params['watchlist'], $titleObj ) || $wgUser->getOption( 'watchcreations' ); + $watch = $this->getWatchlistValue( $params['watchlist'], $titleObj ); // Deprecated parameters if ( $params['watch'] ) { diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index 34691334db..f81ea24cff 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -248,7 +248,7 @@ class ApiUpload extends ApiBase { } $file = $this->mUpload->getLocalFile(); - $watch = $this->getWatchlistValue( $params['watchlist'], $file->getTitle() ) || $wgUser->getOption( 'watchcreations' ); + $watch = $this->getWatchlistValue( $params['watchlist'], $file->getTitle() ); // Deprecated parameters if ( $this->mParams['watch'] ) { -- 2.20.1