I'm getting the following error in checkout:

Fatal error: Class name must be a valid object or a string in includes/common.inc on line 7749

This happens after disabling commerce_coupon and the modules that depend on it. I tried uninstalling those, and also reverted my edit to a Rule, to no avail. It looks like the commerce_coupon entity isn't removed somehow, as it's still being instantiated, as you can see in this debug backtrace.

17: entity_get_controller() (Array, 2 elements)

    file (String, 24 characters ) includes/common.inc:7749
    args (Array, 1 element)
        0 (String, 15 characters ) commerce_coupon

16: entity_load() (Array, 2 elements)

    file (String, 24 characters ) includes/common.inc:7716
    args (Array, 2 elements)
        0 (String, 15 characters ) commerce_coupon
        1 (Array, 0 elements)

15: entityreference_field_widget_form() (Array, 2 elements)

    file (String, 60 characters ) sites/all/modules/entityreference/entityreferen...
        sites/all/modules/entityreference/entityreference.module:820
    args (Array, 8 elements)

14: field_multiple_value_form() (Array, 2 elements)
13: field_default_form() (Array, 2 elements)
12: _field_invoke() (Array, 2 elements)
11: _field_invoke_default() (Array, 2 elements)
10: field_attach_form() (Array, 2 elements)
 9: commerce_fieldgroup_panes_contents_checkout_form() (Array, 2 elements)
 8: commerce_checkout_form() (Array, 2 elements)
 7: call_user_func_array() (Array, 1 element)
 6: drupal_retrieve_form() (Array, 2 elements)
 5: drupal_build_form() (Array, 2 elements)
 4: drupal_get_form() (Array, 2 elements)
 3: commerce_checkout_router() (Array, 2 elements)
 2: call_user_func_array() (Array, 1 element)
 1: menu_execute_active_handler() (Array, 2 elements)
 0: main() (Array, 2 elements) 

Comments

a.ross’s picture

I had to remove the coupon field from the order entity manually.

I did this by going into admin/commerce/config/order/fields and removed a field called Coupon (commerce_coupon_order_reference)

pcambra’s picture

Status: Active » Closed (cannot reproduce)

I can't reproduce this problem, on disabling everything looks fine...

The workaround you posted is a little drastic but effective, uninstall function does that:

  // Delete all fields that belong to the module's entity types.
  commerce_delete_instances('commerce_coupon_log');
  commerce_delete_instances('commerce_coupon');
  commerce_delete_field('commerce_coupon_order_reference');
  commerce_delete_field('commerce_coupon_reference');
kevster’s picture

Great - this fixed my issue also. I had turned off coupon but didnt uninstall so it broke any order/edit pages. I just uninstalled and all is working now - thx guys..

kevster’s picture

Issue summary: View changes

Make the backtrace a bit more readable