r102783 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102782‎ | r102783 | r102784 >
Date:14:23, 11 November 2011
Author:catrope
Status:ok
Tags:
Comment:
[RL2] Properly fix the live hack from r99889
Modified paths:
  • /branches/RL2/extensions/Gadgets/Gadgets.hooks.php (modified) (history)

Diff [purge]

Index: branches/RL2/extensions/Gadgets/Gadgets.hooks.php
@@ -79,7 +79,9 @@
8080 }
8181
8282 $prevTs = wfTimestampNow();
 83+ $thisTs = wfTimestampNow();
8384 if ( $revision ) { // $revision is null for null edits
 85+ $thisTs = $revision->getTimestamp();
8486 $previousRev = $revision->getPrevious();
8587 if ( $previousRev ) { // $previousRev is null if there is no previous revision
8688 $prevTs = $previousRev->getTimestamp();
@@ -90,7 +92,7 @@
9193 $repo = LocalGadgetRepo::singleton();
9294 // TODO: Timestamp in the constructor is ugly
9395 $gadget = new Gadget( $id, $repo, $text, $prevTs );
94 - $repo->modifyGadget( $gadget, $revision ? $revision->getTimestamp() : $revision );
 96+ $repo->modifyGadget( $gadget, $thisTs );
9597
9698 // modifyGadget() returns a Status object with an error if there was a conflict,
9799 // but we don't care. If a conflict occurred, that must be because a newer edit's

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99889[RL2] Commit live hack. Saving gadget on prototype/rl2_repo1 failed when tryi...krinkle16:02, 15 October 2011

Status & tagging log