Matthias Mullie has uploaded a new change for review.

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

Change subject: Don't reimport existing headers
......................................................................

Don't reimport existing headers

maintenance/FlowRestoreLQT.php will restore LQT board content,
causing new revisions. The DB source store (or even the filebased
source store, should it exist there) would not be able to find
these headers since they won't match the already imported header.

Instead of using the unreliable source store id, let's just use
the already known workflow id...

Bug: T119509
Change-Id: I881910977a8826ca5a389c1eb832844ece4dbb93
(cherry picked from commit 80f7b4ee2280d0979deae4fb1881397f2d3ff697)
---
M includes/Import/Importer.php
M includes/Import/LiquidThreadsApi/Objects.php
2 files changed, 11 insertions(+), 3 deletions(-)


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

diff --git a/includes/Import/Importer.php b/includes/Import/Importer.php
index 8604297..1cff2fa 100644
--- a/includes/Import/Importer.php
+++ b/includes/Import/Importer.php
@@ -640,7 +640,15 @@
                        return;
                }
 
-               $existingId = $pageState->getImportedId( $importHeader );
+               /*
+                * We don't need $pageState->getImportedId( $importHeader ) 
here, there
+                * can only be 1 header per workflow and we already know the 
workflow,
+                * might as well query it from the workflow instead of using 
the id from
+                * the source store.
+                * reason I prefer not to use source store is that a header 
import is
+                * incomplete (it doesn't import full history, just the last 
revision.
+                */
+               $existingId = $pageState->boardWorkflow->getId();
                if ( $existingId && $pageState->getTopRevision( 'Header', 
$existingId ) ) {
                        $pageState->logger->info( 'header previously imported' 
);
                        return;
diff --git a/includes/Import/LiquidThreadsApi/Objects.php 
b/includes/Import/LiquidThreadsApi/Objects.php
index 0eca7fc..7f92f4c 100644
--- a/includes/Import/LiquidThreadsApi/Objects.php
+++ b/includes/Import/LiquidThreadsApi/Objects.php
@@ -310,7 +310,7 @@
 
 class ImportRevision implements IObjectRevision {
        /** @var IImportObject **/
-       protected $parentObject;
+       protected $parent;
 
        /** @var array **/
        protected $apiResponse;
@@ -420,7 +420,7 @@
 // Represents a revision the script makes on its own behalf, using a script 
user
 class ScriptedImportRevision implements IObjectRevision {
        /** @var IImportObject **/
-       protected $parentObject;
+       protected $parent;
 
        /** @var User */
        protected $destinationScriptUser;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I881910977a8826ca5a389c1eb832844ece4dbb93
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: wmf/1.28.0-wmf.7
Gerrit-Owner: Matthias Mullie <mmul...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to