From 44d8a85202f722ba5c30f91642738c86a8723382 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Tue, 14 Jun 2011 13:10:26 +0000 Subject: [PATCH] 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? --- includes/api/ApiWatch.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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' ); -- 2.20.1