Hi

I have installed the latest dev version of commerce kickstart but whenever i want to edit an order i got this message:

Fatal error: Class name must be a valid object or a string in E:\xampp\htdocs\dhl\includes\common.inc on line 7894

I tried the same operation on another site using commerce kickstart dev version but there is no problem in it

I have this module installed in my site: cck phone,commerce stock,field validation,fivestar,userpoints,votingapi

So what could be the reason for this error? and how fix it?

Comments

Status:Active» Fixed

The error is too generic for me to be able to debug it.
I was unable to reproduce it on multiple installs.

If you find a solution, let us know.

Hello, I too have the same problem when trying to edit an order. - but I'm not using commerce kickstart but just drupal commerce.

I get:
Fatal error: Class name must be a valid object or a string in /var/www/vhosts/****/****/****/includes/common.inc on line 7749.

please check my pm for my site details.

Fixed - there is a bug somewhere, installed the "commerce coupon" module

I discovered the reason behind this error message it seems that i have to enable the commerce discount module for the order editing page to work because the site using a controller class from this module despite that this module is enabled or not i think this problem is caused by one of the commerce kickstart custom modules

Category:support» bug
Status:Fixed» Active

I think it's better to reopen this issue as a bug report so it could be fixed in the next dev version of commerce kickstart

#4 works for me. Reenabling DISCOUNTS make this work again.

Project:Commerce Kickstart» Commerce Coupon
Version:7.x-2.x-dev» 7.x-1.x-dev

This issue is coming from the commerce_coupon module, this module adds a commerce_coupon_order_reference_field on the order that is deleted on hook_uninstall()..
This means that if you use drush to disable commerce_coupon using the drush dis command, the hook_uninstall won't be fired, the field will remain, but the entity commerce_coupon is no longer declared.
This could be fixed by implementing a hook_disable() instead.

i didn't install the commerce coupon module on my site so it's impossible that this problem could be from this module

I think we're sharing the pain in commerce coupon and commerce discount
http://drupalcode.org/project/commerce_discount.git/blob/refs/heads/7.x-...

I've opened this issue in Entity Reference to improve the check on disabled entities.

#1940540: Don't load the widget form if the entity type referenced doesn't exist

#4 and #10 do not work for me

Trying to get property of non-object in commerce_coupon_commerce_cart_order_refresh() (line 1077 in /.../www/sites/all/modules/commerce_coupon/commerce_coupon.module).
EntityMetadataWrapperException : Unable to get the data property commerce_unit_price as the parent data structure is not set. in EntityStructureWrapper->getPropertyValue() (line 442 in /.../www/profiles/commerce_kickstart/modules/contrib/entity/includes/entity.wrapper.inc).

Moreover, trying to desactivate commerce coupon (and UI and ... the other one : i had also commerce_coupon_pct-7.x-1.0-beta7), when editing a command, i got:

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

i had to uninstall them

corbin, your error is completely unrelated as it's referring to commerce_unit_price and we're dealing with entity reference in this issue.

!?!?

Error message when trying to edit an order

Fatal error: Class name must be a valid object or a string in....

didn't i read this at the beginning of the post ?

and also

This issue is coming from the commerce_coupon module

??

!?!?

Don't speak Qbert, sorry ;)

The output error might be the same, but your error is coming from a very different place and may or may not be related to commerce coupon.

You're getting

EntityMetadataWrapperException : Unable to get the data property commerce_unit_price

That's something related with your line item structure.

uninstalling coupon chance makes things well : no more problem now

I'm using the latest version. For me the error comes from commerce discount. I had to enable it in order to add or edit an order.

Same error. Enabling commerce discount fix it.

commerce discount was activated and it was not fixed

I was getting the same issue and Enabling "Commerce Discount" fixed it for me.

I was the same probleme, ens commerce discont really fixed.
My problem that I use Commerce sale price, because i have different discount / product, but sale price and commerce discount usage one time give me a database error.

Maybe there is a relationship between order and discount.

Status:Active» Postponed (maintainer needs more info)

The solution for the entity reference fields is in #10 already, not much that we can do.

My suggestion if the error it's NOT related to entity reference field is to install commerce coupon using simplytest me or a default install in a dev box and compare what fields are missing for you, I can't reproduce this problem outside entity reference context (that's what the fix in #10 is for) in a consistent way, so I'm marking this as need more info until someone can provide it.

Status:Postponed (maintainer needs more info)» Fixed

Just got the patch in #10 committed into Entity Reference
http://drupalcode.org/project/entityreference.git/commit/1c176da

Please update to the latest ER development version and try again, if you still get the error, open a new issue with details to reproduce the problem.

Status:Fixed» Closed (fixed)

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

Priority:Normal» Critical
Status:Closed (fixed)» Active

I still have this problem. I have Commerce Discount enabled and installed the last version with the patch in #10 applied. Nothing changed.

Status:Active» Closed (fixed)

Please post a new issue with more details about your error on it.

I need the error you're getting, but please, in another issue, let's keep this one alone.

Done.

I seem to have a resolution. It works for me at least. Instead of disabling discount just disable the other discount modules discount ui and discount date if you don't want to use discounts and it should work. I was getting an error when adding to cart so I disabled discount and then I got an error editing orders which is fixed when enabling discounts. So I went half way and it seems to work.

Anything that interacts with the order data seems to be clashing and causing the error. Both discount and coupon modules being enabled and disabled, probably without running the update script, seem to be related to the error.

Commerce discount gives errors when enabling and disabling, says

FieldException: Attempt to create an instance of field commerce_discount_offer on bundle order_discount that already has an instance of that field. in field_create_instance()

Coupon and discount modules are both causing this.

Issue summary:View changes

Remove the blockquote

I got the same error.

For me the solutions was installing Drupal Commerce Coupon, and enable it. Although I don't even use it on the site. Weird, weird.

This worked for me:
Do not just disable Commerce Coupon. Uninstall it as well at /admin/modules/uninstall

Yes, same thing with Commerce Discount: needed to uninstall it after disabling it.