Revert r64955
authorSam Reed <reedy@users.mediawiki.org>
Mon, 12 Apr 2010 10:44:45 +0000 (10:44 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Mon, 12 Apr 2010 10:44:45 +0000 (10:44 +0000)
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
includes/api/ApiEditPage.php
includes/api/ApiUpload.php

index 5f2a185..b90b0be 100644 (file)
@@ -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;
 
index 77377b0..02eca54 100644 (file)
@@ -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'] ) {
index 3469133..f81ea24 100644 (file)
@@ -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'] ) {