1. install (success)
  2. uninstall (success)
  3. re-install (error)
    Unable to install File Browser, embed.button.file_browser, image.style.file_entity_browser_thumbnail already exist in active configuration.

I need to delete both manually from config table to get to install again.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ksavoie created an issue. See original summary.

samuel.mortenson’s picture

Are these bugs specific to File Browser or are all modules that provide this kind of config subject to this error? I'm wondering if this should be a core issue or closed in lieu of an existing core issue.

ksavoie’s picture

I have un-/re-installed other modules without issue, but to be honest I have had this problem with a couple of modules in some capacity but many of the modules I am using are -dev as their are so few D8s that have production versions yet so I'm not surprised. I'm guessing that this issue is module specific and probably only because it's early -dev. I'm not overly worried about it as it does seem to function satisfactorily. I just wanted to get this on the list to be reviewed.

aspilicious’s picture

The image style config should have a dependency on the module (somewhere).

OR you can move the config to a folder names "optional".
Than it will be installed if it doesn't exist yet.

samuel.mortenson’s picture

@aspilicious Ah, that makes sense. I would prefer the dependency as both of those pieces of config are (mostly) useless without File Browser. Thanks for the tip!

samuel.mortenson’s picture

Status: Active » Needs review
FileSize
1.14 KB

Here's a patch that adds those missing dependencies.

ChrisGrewe’s picture

I've had a similar problem with custom modules (and I just had this problem with File Browser too). The dependency may or may not be enough to get the config to remove itself properly. I've also taken to using hook_uninstall to clean up any configuration my module uses during the uninstall (suggestion came from elsewhere a few weeks ago, can't remember exactly where I read it first). For example, something like this:

function file_browser_uninstall() {
  Drupal::configFactory()->getEditable('image.style.file_entity_browser_thumbnail')->delete();
}

With a similar line for each part of the configuration that needs to be uninstalled. That might help to mitigate these types of issues.

jibran’s picture

Title: Install/Uninstall/Install Error » Clean up after uninstall
FileSize
552 bytes

This is a correct fix.

jibran’s picture

+++ b/file_browser.info.yml
@@ -10,6 +10,7 @@ dependencies:
+  - image

We can keep this as well.

jibran’s picture

FileSize
268 bytes
820 bytes

I think it is ready now.

samuel.mortenson’s picture

Status: Needs review » Fixed

Ran drush si standard -y && drush en file_browser -y && drush pmu file_browser -y && drush en file_browser -y, no errors! Thanks @jibran.

jibran’s picture

Thanks @samuel.mortenson.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

jibran’s picture

Created #2712669: Clean up after uninstall for content browser.

Sam152’s picture

FileSize
1.84 KB

I believe this is actually the correct fix. The uninstall process will warn you config will be deleted this way.