diff --git a/core/modules/workspaces/src/WorkspaceManager.php b/core/modules/workspaces/src/WorkspaceManager.php index 20b0519e14..435ec60d15 100644 --- a/core/modules/workspaces/src/WorkspaceManager.php +++ b/core/modules/workspaces/src/WorkspaceManager.php @@ -319,7 +319,7 @@ public function purgeDeletedWorkspacesBatch() { $workspace_id = reset($deleted_workspace_ids); $all_associated_revisions = []; - foreach (array_keys($this->getSupportedEntityTypes()) as $entity_type_id) { + foreach (array_keys($this->workspaceInfo->getSupportedEntityTypes()) as $entity_type_id) { $all_associated_revisions[$entity_type_id] = $this->workspaceAssociation->getAssociatedRevisions($workspace_id, $entity_type_id); } $all_associated_revisions = array_filter($all_associated_revisions); @@ -359,7 +359,7 @@ public function purgeDeletedWorkspacesBatch() { // request a fresh list of tracked entities. If it is empty, we can go ahead // and remove the deleted workspace ID entry from state. $has_associated_revisions = FALSE; - foreach (array_keys($this->getSupportedEntityTypes()) as $entity_type_id) { + foreach (array_keys($this->workspaceInfo->getSupportedEntityTypes()) as $entity_type_id) { if (!empty($this->workspaceAssociation->getAssociatedRevisions($workspace_id, $entity_type_id))) { $has_associated_revisions = TRUE; break; diff --git a/core/modules/workspaces/tests/src/Kernel/WorkspaceTestTrait.php b/core/modules/workspaces/tests/src/Kernel/WorkspaceTestTrait.php index 7d6cfdeb99..0fd6c43b45 100644 --- a/core/modules/workspaces/tests/src/Kernel/WorkspaceTestTrait.php +++ b/core/modules/workspaces/tests/src/Kernel/WorkspaceTestTrait.php @@ -39,7 +39,7 @@ protected function initializeWorkspacesModule() { // Install the entity schema for supported entity types to ensure that the // 'workspace' revision metadata field gets created. - foreach (array_keys($this->workspaceManager->getSupportedEntityTypes()) as $entity_type_id) { + foreach (array_keys(\Drupal::service('workspaces.information')->getSupportedEntityTypes()) as $entity_type_id) { $this->installEntitySchema($entity_type_id); } diff --git a/core/modules/workspaces/workspaces.module b/core/modules/workspaces/workspaces.module index a0c92c557b..08c138b7c1 100644 --- a/core/modules/workspaces/workspaces.module +++ b/core/modules/workspaces/workspaces.module @@ -148,7 +148,7 @@ function workspaces_entity_predelete(EntityInterface $entity) { * Implements hook_entity_delete(). */ function workspaces_entity_delete(EntityInterface $entity) { - if (\Drupal::service('workspaces.manager')->isEntityTypeSupported($entity->getEntityType())) { + if (\Drupal::service('workspaces.information')->isEntityTypeSupported($entity->getEntityType())) { \Drupal::service('workspaces.association') ->deleteAssociations(NULL, $entity->getEntityTypeId(), [$entity->id()]); } @@ -158,7 +158,7 @@ function workspaces_entity_delete(EntityInterface $entity) { * Implements hook_entity_revision_delete(). */ function workspaces_entity_revision_delete(EntityInterface $entity) { - if (\Drupal::service('workspaces.manager')->isEntityTypeSupported($entity->getEntityType())) { + if (\Drupal::service('workspaces.information')->isEntityTypeSupported($entity->getEntityType())) { \Drupal::service('workspaces.association') ->deleteAssociations(NULL, $entity->getEntityTypeId(), [$entity->id()], [$entity->getRevisionId()]); }