Install profile fails when custom fields are assigned to the default product/variation types in config

Created on 9 August 2017, over 7 years ago
Updated 18 January 2025, 2 months ago

Problem

When a custom field (a plain-text field, etc.) is added to the "default" product type or variation type and configuration is exported and moved into an install profile, the profile won't install. Error page is returned with unmet dependencies errors, example below.

If you instead leave the "default" product and variation type alone, and create a new custom product and variation type, and add custom fields to those, then export config, the install profile installs successfully.

Example of error returned:

The website encountered an unexpected error. Please try again later.
Drupal\Core\Config\UnmetDependenciesException: Configuration objects provided by <em class="placeholder">orange_ecom_profile</em> have unmet dependencies: <em class="placeholder">block.block.footer_navigation (menu_block), block.block.searchform (search), block.block.seven_help (help), commerce_checkout.commerce_checkout_flow.default (commerce_checkout), commerce_order.commerce_order_item_type.default (commerce_product), commerce_tax.commerce_tax_type.canadian_tax (commerce_tax), contact.form.personal (contact), core.base_field_override.menu_link_content.menu_link_content.changed (menu_link_content), core.entity_form_display.commerce_order_item.default.add_to_cart (commerce_cart, commerce_product), core.entity_form_display.commerce_product_variation.default.default (image), core.entity_form_display.node.cta_homepage.default (image, link), core.entity_form_display.node.page.default (field_group, image, webform), core.entity_form_mode.commerce_order_item.add_to_cart (commerce_cart), core.entity_view_display.node.page.default (webform), core.entity_view_mode.commerce_log.token (commerce_log), core.entity_view_mode.commerce_payment.token (commerce_payment), core.entity_view_mode.commerce_promotion.token (commerce_promotion), core.entity_view_mode.paragraph.preview (paragraphs), core.entity_view_mode.taxonomy_term.full (taxonomy), field.field.node.cta_homepage.field_cta_link (link), field.storage.commerce_product_variation.field_product_image (commerce_product, image), imce.profile.admin (imce), language.content_settings.comment.node_comment (content_translation, language), language.content_settings.node.blog_post (language), metatag.metatag_defaults.403 (metatag), node.type.blog_post (menu_ui), pathauto.pattern.blog_posts (pathauto), pathauto.pattern.blog_taxonomy (ctools, taxonomy, pathauto), pathauto.pattern.taxonomy_default (taxonomy, pathauto), rdf.mapping.user.user (rdf), shortcut.set.default (shortcut)</em> in Drupal\Core\Config\UnmetDependenciesException::create() (line 98 of core\lib\Drupal\Core\Config\UnmetDependenciesException.php).
Drupal\Core\Config\UnmetDependenciesException::create('orange_ecom_profile', Array) (Line: 469)
Drupal\Core\Config\ConfigInstaller->checkConfigurationToInstall('module', 'orange_ecom_profile') (Line: 132)
Drupal\Core\ProxyClass\Config\ConfigInstaller->checkConfigurationToInstall('module', 'orange_ecom_profile') (Line: 141)
Drupal\Core\Extension\ModuleInstaller->install(Array, ) (Line: 83)
Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array, ) (Line: 1572)
install_install_profile(Array) (Line: 662)
install_run_task(Array, Array) (Line: 540)
install_run_tasks(Array) (Line: 117)
install_drupal(Object) (Line: 44)

Proposed resolution

Have an install profile install successfully if custom fields are assigned to the default product type and/or variation type.

πŸ› Bug report
Status

Active

Version

2.0

Component

Product

Created by

πŸ‡¨πŸ‡¦Canada cbildstein

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.

  • πŸ‡ΊπŸ‡ΈUnited States bradjones1 Digital Nomad Life

    Ran into this today but in commerce_checkout. Basically if you have deleted the default product variation type prior to enabling commerce_checkout (because you're a brash power-user like me and go wild in the UI when you first install stuff) then you'll get

    Configuration objects provided by <em class="placeholder">commerce_checkout</em> have unmet dependencies: <em class="placeholder">core.entity_view_display.commerce_product_variation.default.summary (commerce_product.commerc  
      e_product_variation_type.default)</em>

    which is basically the same underlying issue.

Production build 0.71.5 2024