From: Niklas Laxström Date: Tue, 14 Jun 2011 13:10:26 +0000 (+0000) Subject: FU r89545: change broke api watching by switching watch and unwatch around. X-Git-Tag: 1.31.0-rc.0~29541 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/categories/modifier.php?a=commitdiff_plain;h=44d8a85202f722ba5c30f91642738c86a8723382;p=lhc%2Fweb%2Fwiklou.git FU r89545: change broke api watching by switching watch and unwatch around. Also added zero to the article constructor..how many subtle bugs we need to make default article constructor sane? --- diff --git a/includes/api/ApiWatch.php b/includes/api/ApiWatch.php index 8e76eeb182..241e25d88b 100644 --- a/includes/api/ApiWatch.php +++ b/includes/api/ApiWatch.php @@ -53,17 +53,17 @@ class ApiWatch extends ApiBase { $this->dieUsageMsg( array( 'invalidtitle', $params['title'] ) ); } - $article = new Article( $title ); + $article = new Article( $title, 0 ); $res = array( 'title' => $title->getPrefixedText() ); if ( $params['unwatch'] ) { $res['unwatched'] = ''; $res['message'] = wfMsgExt( 'removedwatchtext', array( 'parse' ), $title->getPrefixedText() ); - $success = WatchAction::doWatch( $title, $wgUser ); + $success = WatchAction::doUnwatch( $title, $wgUser ); } else { $res['watched'] = ''; $res['message'] = wfMsgExt( 'addedwatchtext', array( 'parse' ), $title->getPrefixedText() ); - $success = UnwatchAction::doUnwatch( $title, $wgUser ); + $success = UnwatchAction::doWatch( $title, $wgUser ); } if ( !$success ) { $this->dieUsageMsg( 'hookaborted' );