Subject: [PATCH] migrate-control. El skip_high_water ha de ir en un patch que afecta al source del core
---
Index: core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php b/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php
--- a/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php	(revision a8ba80ed34c013969483203a9352d15fc3c20b78)
+++ b/core/modules/migrate/src/Plugin/migrate/source/SourcePluginBase.php	(revision 64e7f33370d70cf85ad75d63a60196f13f6d398b)
@@ -54,6 +54,8 @@
  *   (optional table alias). This high_water_property is typically a timestamp
  *   or serial id showing what was the last imported record. Only content with a
  *   higher value will be imported.
+ * - skip_high_water: (optional) If set, ignore the high-water mark and process
+ *   all rows regardless of their high-water value.
  * - constants: (optional) An array of constants that can be used in the process
  *   pipeline. To use the constant 'foo' as a source value use 'constants/foo'.
  *
@@ -192,6 +194,13 @@
    */
   protected $skipCount = FALSE;

+  /**
+   * Whether to skip high water mark checks.
+   *
+   * @var bool
+   */
+  protected $skipHighWater = FALSE;
+
   /**
    * Flags whether to track changes to incoming data.
    *
@@ -248,6 +257,12 @@
         $this->$property = (bool) $configuration[$config_key];
       }
     }
+
+    // Check if skip-high-water
+    $config_factory = \Drupal::configFactory();
+    $config = $config_factory->get('migrate_control.settings');
+    $this->skipHighWater = (bool) ($config->get('skip_high_water') ?? FALSE);
+
     if ($this->cacheCounts) {
       $this->cacheKey = $configuration['cache_key'] ?? $plugin_id . '-' . hash('sha256', Json::encode($configuration));
     }
@@ -425,11 +440,11 @@
       // 2. Explicitly set to update.
       // 3. The row is newer than the current high-water mark.
       // 4. If no such property exists then try by checking the hash of the row.
-      if (!$row->getIdMap() || $row->needsUpdate() || $this->aboveHighWater($row) || $this->rowChanged($row)) {
+      if ($this->skipHighWater || !$row->getIdMap() || $row->needsUpdate() || $this->aboveHighWater($row) || $this->rowChanged($row)) {
         $this->currentRow = $row->freezeSource();
       }

-      if ($this->getHighWaterProperty()) {
+      if ($this->getHighWaterProperty() && !$this->skipHighWater) {
         $this->saveHighWater($row->getSourceProperty($this->highWaterProperty['name']));
       }
     }
Index: core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php
--- a/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php	(revision a8ba80ed34c013969483203a9352d15fc3c20b78)
+++ b/core/modules/migrate/src/Plugin/migrate/source/SqlBase.php	(revision 64e7f33370d70cf85ad75d63a60196f13f6d398b)
@@ -313,8 +313,8 @@
         $added_fields[] = "$alias.source_row_status";
       }
       // 2. If we are using high water marks, also include rows above the mark.
-      //    But, include all rows if the high water mark is not set.
-      if ($this->getHighWaterProperty()) {
+      //    But, include all rows if the high water mark is not set or if skipHighWater is true.
+      if ($this->getHighWaterProperty() && !$this->skipHighWater) {
         $high_water_field = $this->getHighWaterField();
         $high_water = $this->getHighWater();
         // We check against NULL because 0 is an acceptable value for the high
