From: Sam Reed Date: Mon, 12 Apr 2010 10:44:45 +0000 (+0000) Subject: Revert r64955 X-Git-Tag: 1.31.0-rc.0~37134 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=d840fbbc953189abf66f8b3ad3b544f8064dc3c9;p=lhc%2Fweb%2Fwiklou.git 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 --- 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'] ) {