Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Order
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
15 Feb 2016 at 13:48 UTC
Updated:
14 Mar 2016 at 15:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
bojanz commentedWe need to make sure all of our shipped configuration has a dependency on the parent module (commerce_order for modules/order/config, etc). That will cause Drupal to clean up after a module removal. I think that's done automatically for required config, but isn't done for optional config.
Comment #3
czigor commentedComment #4
czigor commentedTested this with installing-uninstalling-installing all commerce modules.
E.g.
drupal module:install commerce
drupal module:uninstall commerce
drupal module:install commerce
I got no complaints about existing config.
Comment #5
harings_rob commentedLooks good to me, I have checked all (sub)modules and enabled + disabled them a few times.
Comment #6
bojanz commentedI think we went a bit overboard here.
commerce_order and commerce_price are calculated dependencies, they are fine as they are. We don't need to move calculated dependencies to enforced.
This example needs an enforced dependency on commerce_cart, since commerce_cart provides the configuration.
The rule, which I've just learned is:
Modules providing configuration for types they don't own need to add an enforced dependency on themselves.
For example, cart/config/install/views.view.commerce_cart_block.yml. This is a view, so there's an implicit dependency added on the "views" module.
But there's no dependency on commerce_cart, that's the one that needs to be enforced.
Comment #7
czigor commentedThanks for the explanation! I have changed the patch accordingly.
Comment #9
bojanz commentedThank you, committed.
Views is supposed to always add a dependency on the providing module (the only config entity that does that), and yet that failed for the Shopping cart block for some reason. I worked around it by enforcing the dependency for now.
This situation is a mess, I've commented on this core issue: #2461513: The ConfigInstaller should add a dependency on the extension used to install the configuration.
Also opened an issue for adding a test to Commerce: #2677932: Add a test for reinstalling Commerce