Issue #3108416 by catch, amateescu, alexpott, xjm: Remove workspace_update_8803()

merge-requests/2419/head
Alex Pott 2020-03-05 08:58:41 +00:00
parent 19cf46cc31
commit 6cad09c147
No known key found for this signature in database
GPG Key ID: 31905460D4A69276
2 changed files with 7 additions and 26 deletions

View File

@ -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',
]),

View File

@ -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;
}