Passing the undid revisionId from the API request to the WebRequest
authorKaldari <rkaldari@wikimedia.org>
Sun, 28 Oct 2012 23:05:40 +0000 (16:05 -0700)
committerKaldari <rkaldari@wikimedia.org>
Mon, 29 Oct 2012 17:58:08 +0000 (10:58 -0700)
This is so that Echo can detect when a revision is undone via the
API. wpUndidRevision is the same param used by the 'undo' button in
in the History view.

Change-Id: I82440eb442759335800cee49fd53528fcfd92ed6

includes/api/ApiEditPage.php

index ca62bc6..3c48d2c 100644 (file)
@@ -246,6 +246,11 @@ class ApiEditPage extends ApiBase {
                        $requestArray['wpSectionTitle'] = $params['sectiontitle'];
                }
 
+               // TODO: Pass along information from 'undoafter' as well
+               if ( $params['undo'] > 0 ) {
+                       $requestArray['wpUndidRevision'] = $params['undo'];
+               }
+
                // Watch out for basetimestamp == ''
                // wfTimestamp() treats it as NOW, almost certainly causing an edit conflict
                if ( !is_null( $params['basetimestamp'] ) && $params['basetimestamp'] != '' ) {