Uninstalling this module removes the wrong coupon type. See the hook_uninstall implementation.


/**
 * Implements hook_uninstall().
 */
function commerce_coupon_pct_uninstall() {
  // Make sure commerce.module is loaded so that commerce_delete_instances()
  // is available.
  module_load_include('module', 'commerce');
  // The function commerce_coupon_type_delete() can't be used here because
  // commerce_coupon module might not be enabled anymore at this point.
  db_delete('commerce_coupon_type')
    ->condition('type', 'commerce_coupon_fixed')
    ->execute();

  // Delete all fields that belong to the module's coupon type.
  commerce_delete_instances('commerce_coupon', 'commerce_coupon_pct');
}

Patch fixes the issue.

CommentFileSizeAuthor
#1 1556478-fix-uninstall.patch599 bytesbeeradb

Comments

beeradb’s picture

Status: Active » Needs review
StatusFileSize
new599 bytes
pcambra’s picture

Status: Needs review » Fixed

Indeed, thanks for catching it.

Committed

Status: Fixed » Closed (fixed)

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