r41649 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41648‎ | r41649 | r41650 >
Date:13:43, 4 October 2008
Author:catrope
Status:old
Tags:
Comment:
(bug 15647) API edit with basetimestamp fails if the page has been deleted and undeleted since the last edit
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiEditPage.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiEditPage.php
@@ -100,8 +100,11 @@
101101 $reqArr['wpEdittime'] = wfTimestamp(TS_MW, $params['basetimestamp']);
102102 else
103103 $reqArr['wpEdittime'] = $articleObj->getTimestamp();
104 - # Fake wpStartime
105 - $reqArr['wpStarttime'] = $reqArr['wpEdittime'];
 104+ if(!is_null($params['starttimestamp']) && $params['starttimestamp'] != '')
 105+ $reqArr['wpStarttime'] = wfTimestamp(TS_MW, $params['starttimestamp']);
 106+ else
 107+ # Fake wpStartime
 108+ $reqArr['wpStarttime'] = $reqArr['wpEdittime'];
106109 if($params['minor'] || (!$params['notminor'] && $wgUser->getOption('minordefault')))
107110 $reqArr['wpMinoredit'] = '';
108111 if($params['recreate'])
@@ -253,6 +256,7 @@
254257 'notminor' => false,
255258 'bot' => false,
256259 'basetimestamp' => null,
 260+ 'starttimestamp' => null,
257261 'recreate' => false,
258262 'createonly' => false,
259263 'nocreate' => false,
@@ -279,6 +283,9 @@
280284 'basetimestamp' => array('Timestamp of the base revision (gotten through prop=revisions&rvprop=timestamp).',
281285 'Used to detect edit conflicts; leave unset to ignore conflicts.'
282286 ),
 287+ 'starttimestamp' => array('Timestamp when you obtained the edit token.',
 288+ 'Used to detect edit conflicts; leave unset to ignore conflicts.'
 289+ ),
283290 'recreate' => 'Override any errors about the article having been deleted in the meantime',
284291 'createonly' => 'Don\'t edit the page if it exists already',
285292 'nocreate' => 'Throw an error if the page doesn\'t exist',
Index: trunk/phase3/includes/api/ApiQueryInfo.php
@@ -403,6 +403,7 @@
404404
405405 if (!is_null($params['token'])) {
406406 $tokenFunctions = $this->getTokenFunctions();
 407+ $pageInfo['starttimestamp'] = wfTimestamp(TS_ISO_8601, time());
407408 foreach($params['token'] as $t)
408409 {
409410 $val = call_user_func($tokenFunctions[$t], $pageid, $title);
@@ -475,6 +476,7 @@
476477 if(!is_null($params['token']))
477478 {
478479 $tokenFunctions = $this->getTokenFunctions();
 480+ $res['query']['pages'][$pageid]['starttimestamp'] = wfTimestamp(TS_ISO_8601, time());
479481 foreach($params['token'] as $t)
480482 {
481483 $val = call_user_func($tokenFunctions[$t], $pageid, $title);
Index: trunk/phase3/RELEASE-NOTES
@@ -291,6 +291,8 @@
292292 be disabled in LocalSettings.php
293293 * (bug 15653) Add prop=duplicatefiles
294294 * (bug 15768) Add list=watchlistraw
 295+* (bug 15647) action=edit with basetimestamp fails if the page has been deleted
 296+ and undeleted since the last edit
295297
296298 === Languages updated in 1.14 ===
297299

Status & tagging log

  NODES
languages 1
Note 2
os 1