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.
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
Comment #2
TR CreditAttribution: TR commentedThat 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.
Comment #3
joshuautley CreditAttribution: joshuautley commentedWhat 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?
Comment #4
TR CreditAttribution: TR commented"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.
Comment #6
joshuautley CreditAttribution: joshuautley commentedThis worked. Thank you.
Comment #7
mondavie CreditAttribution: mondavie commentedWorked for me! Thank you!