Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SystemHooks.php

function SystemHooks::modulesUninstalled

Implements hook_modules_uninstalled().

File

core/modules/system/src/Hook/SystemHooks.php, line 395

Class

SystemHooks
Hook implementations for system.

Namespace

Drupal\system\Hook

Code

public function modulesUninstalled($modules) {
    // @todo Remove this when modules are able to maintain their revision metadata
    //   keys.
    //   @see https://www.drupal.org/project/drupal/issues/3074333
    if (!in_array('workspaces', $modules, TRUE)) {
        return;
    }
    $entity_definition_update_manager = \Drupal::entityDefinitionUpdateManager();
    foreach ($entity_definition_update_manager->getEntityTypes() as $entity_type) {
        if ($entity_type instanceof ContentEntityTypeInterface && $entity_type->hasRevisionMetadataKey('workspace')) {
            $entity_type->setRevisionMetadataKey('workspace', NULL);
            $entity_definition_update_manager->updateEntityType($entity_type);
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal