Commit 74dfef46 authored by catch's avatar catch
Browse files

task: #3561087 Add equivalent updates hook to prevent downgrades from 10.6 to 11.2

By: catch
By: godotislate
By: xjm
By: dww
By: quietone
(cherry picked from commit 68b873a9)
parent 83030b63
Loading
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -152,3 +152,17 @@ function system_update_11202(): void {
    ]);
  }
}

/**
 * Equivalent update to 10600.
 */
function system_update_11300(): TranslatableMarkup|null {
  // This is a no-op that exists to prevent an upgrade from 10.6+ to 11.2. That
  // path is actually a downgrade.
  $equivalent_update = \Drupal::service('update.update_hook_registry')
    ->getEquivalentUpdate();
  if ($equivalent_update instanceof EquivalentUpdate) {
    return $equivalent_update->toSkipMessage();
  }
  return NULL;
}