Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When I uninstall the module and try to install it again I get the following exception:
Drupal\Core\Config\PreExistingConfigException: Configuration objects (single_role.settings) provided by role already exist in active configuration in /var/www/draft/docroot/core/lib/Drupal/Core/Config/PreExistingConfigException.php:65
Proposed resolution
Implement a hook_uninstall()
in modules install file and remove active configuration
\Drupal::configFactory()->getEditable('single_role.settings')->delete();
Comment | File | Size | Author |
---|---|---|---|
#3 | role-Remove_role_configurations_on_uninstall-3084634-3.patch | 373 bytes | Oleksandr Yushchenko |
|
Comments
Comment #2
Oleksandr Yushchenko CreditAttribution: Oleksandr Yushchenko at Lemberg Solutions commentedComment #3
Oleksandr Yushchenko CreditAttribution: Oleksandr Yushchenko at Lemberg Solutions commentedComment #5
ozin