Commit 79df51df authored by catch's avatar catch
Browse files

Issue #3290808 by longwave, catch, Spokje, dww, Lendude: Remove workspaces...

Issue #3290808 by longwave, catch, Spokje, dww, Lendude: Remove workspaces special casing from system_requirements() and fix versions/docs
parent 14a5bf5a
Loading
Loading
Loading
Loading
+9 −11
Original line number Diff line number Diff line
@@ -1368,18 +1368,16 @@ function (callable $hook, string $module) use (&$module_list, $update_registry,
      }
    );

    // If system or workspaces is in the list then only show a specific message
    // for Drupal core.
    if (isset($module_list['system']) || isset($module_list['workspaces'])) {
      $requirements['system_update_last_removed'] = [
    // If user module is in the list then only show a specific message for
    // Drupal core.
    if (isset($module_list['user'])) {
      $requirements['user_update_last_removed'] = [
        'title' => t('The version of Drupal you are trying to update from is too old'),
        'description' => t('Updating to Drupal @current_major is only supported from Drupal version @required_min_version or higher. If you are trying to update from an older version, first update to the latest version of Drupal @previous_major. (<a href=":url">Drupal 9 upgrade guide</a>)', [
          '@current_major' => 9,
          // Workspaces is special cased due to updates being removed after
          // 8.8.0.
          '@required_min_version' => isset($module_list['workspaces']) ? '8.8.2' : '8.8.0',
          '@previous_major' => 8,
          ':url' => 'https://www.drupal.org/docs/9/how-to-prepare-your-drupal-7-or-8-site-for-drupal-9/upgrading-a-drupal-8-site-to-drupal-9',
        'description' => t('Updating to Drupal @current_major is only supported from Drupal version @required_min_version or higher. If you are trying to update from an older version, first update to the latest version of Drupal @previous_major. (<a href=":url">Drupal upgrade guide</a>)', [
          '@current_major' => 10,
          '@required_min_version' => '9.3.0',
          '@previous_major' => 9,
          ':url' => 'https://www.drupal.org/docs/upgrading-drupal/drupal-8-and-higher',
        ]),
        'severity' => REQUIREMENT_ERROR,
      ];
+3 −3
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ public function testLastRemovedVersion() {
    $update_registry = \Drupal::service('update.update_hook_registry');

    $update_registry->setInstalledVersion('update_test_last_removed', 8000);
    $update_registry->setInstalledVersion('system', 8804);
    $update_registry->setInstalledVersion('user', 9300);

    // Access the update page with a schema version that is too old for system
    // and the test module, only the generic core message should be shown.
@@ -68,14 +68,14 @@ public function testLastRemovedVersion() {
    $assert_session = $this->assertSession();
    $assert_session->pageTextContains('Requirements problem');
    $assert_session->pageTextContains('The version of Drupal you are trying to update from is too old');
    $assert_session->pageTextContains('Updating to Drupal 9 is only supported from Drupal version 8.8.0 or higher. If you are trying to update from an older version, first update to the latest version of Drupal 8');
    $assert_session->pageTextContains('Updating to Drupal 10 is only supported from Drupal version 9.3.0 or higher. If you are trying to update from an older version, first update to the latest version of Drupal 9');
    $assert_session->pageTextNotContains('Unsupported schema version: Update test with hook_update_last_removed() implementation');

    $assert_session->linkNotExists('Continue');

    // Update the installed version of system and then assert that now,
    // the test module is shown instead.
    $update_registry->setInstalledVersion('system', 8902);
    $update_registry->setInstalledVersion('user', 9301);
    $this->drupalGet($this->updateUrl);

    $assert_session->pageTextNotContains('The version of Drupal you are trying to update from is too old');