function SystemHooks::modulesUninstalled
Implements hook_modules_uninstalled().
File
-
core/
modules/ system/ src/ Hook/ SystemHooks.php, line 406
Class
- SystemHooks
- Hook implementations for system.
Namespace
Drupal\system\HookCode
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);
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.