Problem/Motivation
Error on dev, test and prod when accessing URL admin/config/services/acquia-lift-publisher preventing us from testing Acquia Lift integration.
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "commerce_subscription" plugin does not exist. Valid plugin IDs for Drupal\commerce_recurring\SubscriptionTypeManager are: product_variation, standalone, recurring_donation in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | acquia-lift-workaround-skip-bundle_plugin_type-3212195.patch | 1.01 KB | jwilson3 |
Comments
Comment #2
jwilson3Moving this issue to the Lift issue queue.
The problem is that there are two ways to get bundles:
* Via entity api using
$entity_type->getBundleEntityType();* Via annotation using
$entity_type->get('bundle_plugin_type');Lift's ContentPublishingForm was not implemented to work with bundle_plugin_type, only getBundleEntityType(). And Commerce doesn't implement getBundleEntityType() for its entities and instead opts for using the annotations. Bojan explains their reasoning in #2817751: Create an API for bundle plugins.
Lift's ContentPublishingForm::buildForm() loads the bundles with:
By default it gets the $entity_type (commerce_subscription). Then from Subscription::bundleFieldDefinitions() the plugin manager is trying to create an instance of that bundle (commerce_subscription) but that plugin id does not exist.
Because Lift doesn't need to know about the commerce recurring subscription entity type, our workaround for now (PATCH attached) is to have ContentPublishingForm::buildForm() simply skip the entity types that use bundle_plugin_type with this code snippet:
In our opinion, the proper solution would be for Acquia Lift engineering team to look into this issue more deeply to decide how to proceed, and either suggest a compatibility between getBundleEntityType() and bundle_plugin_type in a Drupal core issue, or probably more ideally in the short term, to add support for both methodologies in the acquia_lift module.
I'm marking as needs review, so other maintainers can review this, but probably ultimately it would go back to needs work.
Comment #3
japerryMoving to lift 4.x queue. Likely won't get fixed in the lift module, since the new acquia_perz module has rewritten most of this code.
Comment #4
japerry