Problem with default config when re-installing the module

Created on 4 January 2023, almost 2 years ago
Updated 5 August 2023, over 1 year ago

Problem/Motivation

The default config entity parameters.collection.eca resides in the config/install folder and is being installed when enabling this module. The problem is, when the module gets disabled and then enabled again, that same config entity will be installed again and throws an exception because it already exists.

I know, uninstalling and re-installing modules isn't a mainstream task that happens too often, but we've seen it a couple of times during development and testing of various things, and it would be great to resolve this. I marked it as a task and not a bug for that reason.

Proposed resolution

There are 2 possible ways to resolve this:

  • Uninstall the config entity when disabling the module.
  • Moving the config entity into config/optional, then it would only be installed when possible.

The first approach is more common, the second would potentially keep the setting changes one may have made.

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany jurgenhaas Gottmadingen

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.

  • 🇩🇪Germany mxh Offenburg

    Moving the config entity into config/optional, then it would only be installed when possible.

    I think that's the most appropriate option we have for this.

Production build 0.71.5 2024