Enabling Commerce Recurring without Commerce Product installed is causing installation error

Created on 10 February 2021, almost 4 years ago
Updated 1 August 2024, 5 months ago

Problem/Motivation

I have run into this road block. I enabled the module with drush 10 on Drupal 9.1.* core;
drush -V
Drush Commandline Tool 10.4.0-rc1

drush pm:enable commerce_recurring

In DiscoveryTrait.php line 53:
                                                                                                                  
  The "product_variation" plugin does not exist. Valid plugin IDs for Drupal\commerce_recurring\SubscriptionType  
  Manager are: standalone 

Steps to reproduce

drush pm:enable commerce_recurring
on new instalation

Proposed resolution

where is product_variation?

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇦Canada netgeek123

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇴Norway zaporylie

    I have experienced the same issue installing Commerce Recurring from scratch on a fresh Drupal install - both via UI and Drush, therefore I am updating IS.

    UI:

    The website encountered an unexpected error. Try again later.
    
    Drupal\Component\Plugin\Exception\PluginNotFoundException: The "product_variation" plugin does not exist. Valid plugin IDs for Drupal\commerce_recurring\SubscriptionTypeManager are: standalone in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php). 
    

    CLI:

    <

     [success] Installation complete.  User name: admin  User password: t8EgscG89u
    zaporylie@drupal-commerce-web:/var/www/html$ drush en commerce_recurring
    The following module(s) will be enabled: commerce_recurring, commerce, address, entity, inline_entity_form, token, commerce_price, commerce_order, commerce_store, commerce_number_pattern, entity_reference_revisions, profile, state_machine, commerce_payment, advancedqueue
    
     Do you want to continue? (yes/no) [yes]:
     > 
    
    
    In DiscoveryTrait.php line 53:
                                                                                                                                             
      The "product_variation" plugin does not exist. Valid plugin IDs for Drupal\commerce_recurring\SubscriptionTypeManager are: standalone  
                                                                                                                                             
    
    

    My initial idea is to move the config depending on commerce_product to the config/optional but will have to investigate this a bit closer.

  • 🇳🇴Norway zaporylie

    It seems like the reg regression was unintentional and introduced in #3193200: Add an admin-facing page for viewing the details of a subscription . After some manual testing, I stand by my previous statement - moving the respective config mentioned in #9 from config/install to config/optional does the trick. MR to follow.

  • 🇺🇸United States SocialNicheGuru

    Why not make commerce_product a dependency and keep the files in config/install?
    Aren't they required?

  • Status changed to Needs review 6 months ago
  • 🇳🇴Norway zaporylie

    Commerce Product is not required by Commerce Recurring and the Recurring framework can be used standalone. MR is now open and ready for review. In addition to moving files dependencies were added where required.

  • Pipeline finished with Success
    6 months ago
    Total: 247s
    #222828
  • 🇺🇸United States rszrama

    Looks fine to me. It seems we have varying types of support for "Commerce Recurring without Commerce Product," though in practice I bet there are approximately 0 people using it that way. 🤣

    Still, if moving this to optional doesn't bother anything, works for me!

  • 🇳🇴Norway zaporylie

    I bet there are approximately 0 people using it that way. 🤣

    There's at least one in #11 😉

  • Status changed to Fixed 5 months ago
  • 🇮🇱Israel jsacksick

    Merged, thank you!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024