Mattflaschen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/226746

Change subject: Use post time + 1 min for signature edit as well.
......................................................................

Use post time + 1 min for signature edit as well.

Bug: T105484
Change-Id: Ic9365e73d9b46b5d47877d8a2f596e0f222c08d6
---
M includes/Import/LiquidThreadsApi/Objects.php
1 file changed, 10 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/46/226746/1

diff --git a/includes/Import/LiquidThreadsApi/Objects.php 
b/includes/Import/LiquidThreadsApi/Objects.php
index e61eced..d491a63 100644
--- a/includes/Import/LiquidThreadsApi/Objects.php
+++ b/includes/Import/LiquidThreadsApi/Objects.php
@@ -202,7 +202,7 @@
                        $this,
                        $this->importSource->getScriptUser(),
                        $newWikitext,
-                       wfTimestamp( TS_UNIX )
+                       $lastRevision
                );
                return $clarificationRevision;
        }
@@ -438,13 +438,18 @@
         * @param IImportObject $parentObject Object this is a revision of
         * @param User $destinationScriptUser User that performed this scripted 
edit
         * @param string $revisionText Text of revision
-        * @param string $timestamp Timestamp of generated revision
+        * @param IObjectRevision $baseRevision Base revision, used only for 
timestamp generation
         */
-       function __construct( IImportObject $parentObject, User 
$destinationScriptUser, $revisionText, $timestamp ) {
+       function __construct( IImportObject $parentObject, User 
$destinationScriptUser, $revisionText, $baseRevision ) {
                $this->parent = $parentObject;
                $this->destinationScriptUser = $destinationScriptUser;
                $this->revisionText = $revisionText;
-               $this->timestamp = $timestamp;
+
+               $baseTimestamp = wfTimestamp( TS_UNIX, 
$baseRevision->getTimestamp() );
+
+               // Set a minute after.  If it uses $baseTimestamp again, there 
can be time
+               // collisions.
+               $this->timestamp = wfTimestamp( TS_UNIX, $baseTimestamp + 60 );
        }
 
        public function getText() {
@@ -532,18 +537,12 @@
                ) );
 
                $newWikitext .= "\n\n{{{$templateName}|$arguments}}";
-               $initialHeaderTimestamp = wfTimestamp( TS_UNIX, 
$lastRevision->getTimestamp() );
-
-               // Set a minute after.  If it uses the current timestamp, there 
can be time
-               // collisions with the first generated header ID, which can 
cause wrong UID
-               // ordering.
-               $cleanupTimestamp = wfTimestamp( TS_UNIX, 
$initialHeaderTimestamp + 60 );
 
                $cleanupRevision = new ScriptedImportRevision(
                        $this,
                        $this->source->getScriptUser(),
                        $newWikitext,
-                       $cleanupTimestamp
+                       $lastRevision
                );
                return $cleanupRevision;
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/226746
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic9365e73d9b46b5d47877d8a2f596e0f222c08d6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to