From 6cad09c147a8a2ee7a5c6519e2fb92a1fed54b32 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Thu, 5 Mar 2020 08:58:41 +0000 Subject: [PATCH] Issue #3108416 by catch, amateescu, alexpott, xjm: Remove workspace_update_8803() --- core/modules/system/system.install | 10 ++++++---- core/modules/workspaces/workspaces.install | 23 +--------------------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/core/modules/system/system.install b/core/modules/system/system.install index f5d7c40f22f3..317304ba09b6 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1106,14 +1106,16 @@ function system_requirements($phase) { } } - // If system.module is in the list then only show a specific message for - // Drupal core, otherwise show a more generic message for each module. - if (isset($module_list['system'])) { + // 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'] = [ '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, - '@required_min_version' => '8.8.0', + // 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', ]), diff --git a/core/modules/workspaces/workspaces.install b/core/modules/workspaces/workspaces.install index 273239b93c9c..75185603c1b7 100644 --- a/core/modules/workspaces/workspaces.install +++ b/core/modules/workspaces/workspaces.install @@ -5,7 +5,6 @@ * Contains install, update and uninstall functions for the Workspaces module. */ -use Drupal\Core\Entity\ContentEntityNullStorage; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\workspaces\Entity\Workspace; @@ -125,25 +124,5 @@ function workspaces_schema() { * Implements hook_update_last_removed(). */ function workspaces_update_last_removed() { - return 8802; -} - -/** - * Remove the Workspace Association entity storage if necessary. - */ -function workspaces_update_8803() { - $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager(); - $entity_type = $entity_definition_update_manager->getEntityType('workspace_association'); - - // We can't migrate the workspace association data if the entity type is not - // using its default storage. - // @see workspaces_post_update_move_association_data() - if ($entity_type && $entity_type->getHandlerClasses()['storage'] === 'Drupal\workspaces\WorkspaceAssociationStorage') { - \Drupal::state()->set('workspaces_update_8803.tables', [ - 'base_table' => $entity_type->getBaseTable(), - 'revision_table' => $entity_type->getRevisionTable(), - ]); - $entity_type->setStorageClass(ContentEntityNullStorage::class); - $entity_definition_update_manager->uninstallEntityType($entity_type); - } + return 8803; } -- GitLab