error - unable to install - "system.action.message_delete_action already exists in active configuration"

Created on 19 November 2018, over 5 years ago
Updated 16 January 2024, 5 months ago

When attempting to enable this module in Drupal 8.x the following error message is displayed.


Unable to install Message, system.action.message_delete_action already exists in active configuration.

Apparently, the installer for module - contact_storage - creates this same action during its install.

See contact_storage module file - contact_storage.install - lines 52 to 72 to see the code that creates this conflicting action.

(excerpt from contact_storage.install)



/**
 * Save the bulk delete action to config.
 */
function contact_storage_update_8002() {
  $entity_type_manager = \Drupal::entityTypeManager();
  $module_handler = \Drupal::moduleHandler();

  // Save the bulk delete action to config.
  $config_install_path = $module_handler->getModule('contact_storage')->getPath() . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY;

  // Create action if it doesn't exist.
  $action_storage = $entity_type_manager->getStorage('action');
  $action = $action_storage->load('message_delete_action');
  if (!$action) {
    $storage = new FileStorage($config_install_path);
    $entity_type_manager
      ->getStorage('action')
      ->create($storage->read('system.action.message_delete_action'))
      ->save();
  }
}

πŸ’¬ Support request
Status

Closed: works as designed

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States websiteworkspace

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024