[PP-1] Module does not uninstall cleanly (dependency issue)

Created on 20 November 2017, over 7 years ago
Updated 13 March 2023, about 2 years ago

I've a feeling this might be a wider problem that affects Commerce as a whole, and possibly one caused by core...

I can't uninstall the module because the uninstall form says:

> The Billing period field type is used in the following fields: commerce_order.billing_period, commerce_order_item.billing_period

However, the billing period field on order types and order item types is locked, so I can't delete it myself.

πŸ› Bug report
Status

Postponed

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom joachim

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 pmagunia Philadelphia πŸ‡ΊπŸ‡Έ

    I was able to uninstall Commerce Recurring. Comment #31 helped me.

    What I did was:

    1) Delete as much possible in the Commerce menu Drupal UI (I didn't need to keep Commerce on that machine. You may be able get by without this step.)
    2) Change the lock status to false in the following YAML files:

    config/sync/field.storage.commerce_order.billing_period.yml
    config/sync/field.storage.commerce_order.billing_schedule.yml
    config/sync/field.storage.commerce_order_item.billing_period.yml
    

    3) Import the config
    4) Run the following Drush script:

      
    use Drupal\field\Entity\FieldStorageConfig;
    use Drupal\field\Entity\FieldConfig;
    
    // Deleting field storage.
    FieldStorageConfig::loadByName('commerce_order', 'billing_period')->delete();
    FieldStorageConfig::loadByName('commerce_order_item', 'billing_period')->delete();
    
    

    5) Then finally drush pmu commerce_recurring

    I was able to uninstall it without error messages. You may be able to alter the steps to suit your needs.

Production build 0.71.5 2024