I applied the following patches:

  "No menu item": "https://www.drupal.org/files/issues/2885418-5.commerce_license.No-menu-item-for-licence-admin.patch",
  "Role Configuration form": "https://www.drupal.org/files/issues/2886820-2.commerce_license.add-configuration-form-and-bundle-fields-to-Role-license-type-plugin.patch",
  "License creation/destruction logic in sync with cart/order lifecycle": "https://www.drupal.org/files/issues/2879263-7.commerce_license.License-creationdestruction-logic.patch"

I wanted to uninstall the module and I get:

Unable to determine class for field type 'commerce_plugin_item:commerce_license_type' found in the
         'field.storage.commerce_product_variation.license_type' configuration

I don't know if this is an issue with commerce_license or elsewhere, but if anyone has any ideas I'd appreciate it. If I install the module everything goes back to working - uninstall it and everything is broken.

Comments

chrisrockwell created an issue. See original summary.

chrisrockwell’s picture

Category: Support request » Bug report

Moving to bug report. As I learn more about D8 I think the issue is that maybe we need an @FieldWidget with id commerce_license_type.

chrisrockwell’s picture

I was able to get the site back up by deleting the license_type entries from the config_snapshot and config tables. But now when I go to edit a variation type I receive:

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "commerce_license" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 52 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

So even though commerce_license is uninstalled getDefinition is trying to do get it.

chrisrockwell’s picture

Title: Attempting to uninstall breaks site, but module still listed as uninstalled » Prohibit uninstalling if any product variation type has enabled Licensing

So the issue is when you uninstall this module but there are product variation types with Provides a license checked.

Should the module block uninstallation?

joachim’s picture

Title: Prohibit uninstalling if any product variation type has enabled Licensing » Bundle entities need to declare a dependency on modules that supply traits
Project: Commerce License » Commerce Core
Component: Code » Developer experience
Priority: Normal » Major

I think this is a bug in Commerce's Entity Traits framework.

An entity trait that is applied to a bundle entity should cause that bundle entity to have a config dependency on the module that provides the traits.

So in this case, your product variation type uses the license trait. Your product variation type should have a dependency on the CommLi module which would then mean that uninstalling the CommLi module would cause your product variation type to be deleted -- or uninstalling would be prevented if you had product variation entities of that type.

bojanz’s picture

Status: Active » Closed (duplicate)

We fixed this in the Entity APi version of bundle plugin, which got committed yesterday.
See BundlePluginUninstallValidator.
Closing this issue as a duplicate of #2909973: Update Commerce for Entity API 8.x-1.0-beta1.