Getting

Fatal error: Call to undefined function commerce_coupon_type_disable() in sites/all/modules/commerce_coupon_fixed_amount.install line 27

I am trying to re-install this but can't uninstall it first. Same error happening in percent off module but for the pct.install file

Comments

pcambra’s picture

Maybe we should use drupal_load instead of module_load_include.

sher1’s picture

I was wanting to uninstall because my rules are corrupted for the coupons and the coupon types. Is there some way to fix that? Is there some way to force an uninstall?

pcambra’s picture

Status: Active » Postponed (maintainer needs more info)

You didn't provide feedback about the alternative in #1, anyways, I tweaked it a little so it calls drupal_load now.
If you look to the function it's giving you the error, you'll see that it disables the coupon type (status =0) and sets all coupons to disabled too (is active = 0): http://drupalcode.org/project/commerce_coupon.git/blob/refs/heads/7.x-1....

But this can't be happening on uninstall because that function is called on disable.

sher1’s picture

The error that I am getting is
Call to undefined function commerce_coupon_type_disable()
because this function is not defined in any of the coupon code. I didn't respond to the suggestion because it wasn't the error that was listed above. Are you saying that module_load_include is the reason commerce_coupon_type_disable() is not found?

pcambra’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Call to undefined function commerce_coupon_type_disable()
because this function is not defined in any of the coupon code

Yes, it is:

http://drupalcode.org/project/commerce_coupon.git/blob/refs/heads/7.x-1....

Please, update commerce coupon to the latest dev. Closing this.

sher1’s picture

Status: Closed (cannot reproduce) » Active

I have updated commerce coupon fixed amount, commerce coupon, commerce coupon percent. This function is not found in any of the modules although it is invoked here

commerce_coupon_fixed_amount/commerce_coupon_fixed_amount.install:27: commerce_coupon_type_disable('commerce_coupon_fixed');
commerce_coupon_pct/commerce_coupon_pct.install:49: commerce_coupon_type_disable('commerce_coupon_pct');

Where is that function supposed to be defined?

sher1’s picture

And it still fails on the uninstall

sher1’s picture

Status: Active » Closed (fixed)

So it doesn't exist in the stable line. I found it in the dev line. There should probably be a note on the percent and fixed amount coupon types saying that the dev line requires the dev line of commerce coupon.

pcambra’s picture

Status: Closed (fixed) » Closed (works as designed)

Well, it seems quite clear to me that the -dev versions of submodules should go with the -dev of the main module.

Anyways, I'm trying to push a new beta and I'll create the according releases on the submodules.

sher1’s picture

Looking back, it makes sense now but I was basing it on the fact that the submodules and the beta were on the api 1 version of the coupon module. In any case, things are working much better now. THANKS