Unable to install Product Kit, core.entity_form_display.node.product_kit.default, core.entity_view_display.node.product_kit.default, core.entity_view_display.node.product_kit.teaser, field.field.node.product_kit.body, field.field.node.product_kit.uc_product_image, node.type.product_kit already exist in active configuration.

Comments

joshuautley created an issue. See original summary.

TR’s picture

Category: Bug report » Support request
Priority: Major » Normal
Status: Active » Fixed

That message shows that you already did enable product kit, since that's how those fields and types got defined. To re-install you have to completely remove all those things, which in Drupal 8 is not easy. Because of this, most content types can't be fully uninstalled.

A work-around when you encounter this situation is to temporarily move those files out of the module's config/install, re-enable the module, then move them back in.

joshuautley’s picture

What do you mean by "all of those things"?

If by those things you mean the "Product Kit" I did uninstall it. Now it shows in the list as not installed and if I try to install it I get that error. Thus, there must be something wrong with the uninstall script. Yes?

TR’s picture

"core.entity_form_display.node.product_kit.default, core.entity_view_display.node.product_kit.default, core.entity_view_display.node.product_kit.teaser, field.field.node.product_kit.body, field.field.node.product_kit.uc_product_image, node.type.product_kit"

These are all configuration files that live in uc_product_kit/config/install. When the uc_product_kit module is installed, Drupal core reads in these configuration files and performs actions. The error is saying that those actions have already been performed because uc_product_kit had been enabled some time in the past.

Configuration files for uc_product_kit WILL get uninstalled when uc_product_kit gets uninstalled, but in this case uc_product_kit is providing configuration files for other modules - node.type.product_kit for example is a configuration file for the node module, which will only get automatically uninstalled when the node module gets uninstalled (which never happens). As a result, when you try to re-enable uc_product_kit, Drupal core complains that among other things, node.type.product_kit is already defined.

So what I'm saying is temporarily move all those files out of uc_product/config/install so Drupal core won't see them, enable uc_product_kit, then move them back. For example:

cd ubercart/uc_product_kit/config/install
mv *.yml ../

# Now enable uc_product_kit via the UI at /admin/modules

mv ../*.yml .

This will allow you to re-enable the uc_product_kit module.

Status: Fixed » Closed (fixed)

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

joshuautley’s picture

This worked. Thank you.

mondavie’s picture

Worked for me! Thank you!