Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
EntityMalformedException: Missing bundle property on entity of type commerce_order. in entity_extract_ids() (line 7539 of /var/www/vhosts/mydomain.com/httpdocs/includes/common.inc).
So far, I didn't notice any broken functionality due to this error.
Comments
Comment #1
pcambraNot been able to reproduce this error, do you have some steps to reproduce it?
Comment #2
FriedJam CreditAttribution: FriedJam commentedHi, I'm getting a similar error for the "Redeem a coupon with fixed amount" & "Calculate coupon with percentage amount", & at one point "Apply percentage coupons to product line item" (it disappeared after disabling & re-enabling the module). They display this error:
Error: Data selector commerce-order:commerce-coupon-order-reference for parameter list is invalid
Which then produces a site-wide error when you add a coupon :)
Comment #3
pcambraOh, that's not quite similar, that probably is reflecting that you don't have the coupon order reference field in your order entity.
Could you browse to admin/commerce/config/order/fields and check if there's a coupon_order_reference field there?
Comment #4
FriedJam CreditAttribution: FriedJam commentedYep, there is commerce_coupon_order_reference, but when I click edit I get "Fatal error: Class name must be a valid object or a string in /includes/common.inc on line 7656"
It's highly likely that it's something that I've done - I've been using all of the latest dev releases & come across a number of bugs so I've had to uninstall/install the modules a number of times. Probably somewhere along the way I've done something (possibly in the database) in uninstalling that has caused a knock-on effect. But I thought it'd be worth mentioning in case it is related?
Comment #5
Drupa1ish CreditAttribution: Drupa1ish commented@FriedJam I don't think also that is the same error, @pcambra is right at #3
My error looks the same as http://drupal.org/files/commerse-error-when-editing-an-order.png. #1577596: EntityMalformedException: Missing bundle property on entity of type commerce_customer_profile might be related
Comment #6
pcambraI recommend that you install Commerce Devel and paste the detailed error in here.
Comment #7
Drupa1ish CreditAttribution: Drupa1ish commentedAn ugly workaround...
Changing the widget of the commerce_coupon_order_reference attached to order from autocomplete to select list should fix the issue.
Just hoping this won't break something else...
In order to change the widget field, just temporary comment the line entity_extract_ids() (line 7539 of /var/www/vhosts/trb2.euro-domeni.eu/httpdocs/includes/common.inc) ( than revert the hack)
Comment #8
ponies@FriedJam I'm getting the same error when I try to edit an order. Were you able to track it down?
Comment #9
drupalninja99 CreditAttribution: drupalninja99 commentedI am getting this error "EntityFieldQueryException: Unknown field: commerce_coupon_order_reference in EntityFieldQuery->addFieldCondition() (line 769 of /[path]/includes/entity.inc).
I get this error just after adding a coupon and viewing /admin/commerce/coupons. I am guessing there is some dependency that is not being enforced? I don't understand where the order reference field is required?
I am reading the documentation and I don't see where a reference field is required:
http://drupalcode.org/project/commerce_coupon.git/blob_plain/refs/heads/...
I am reading #7 and I see:
"Changing the widget of the commerce_coupon_order_reference attached to order from autocomplete to select list should fix the issue.
Just hoping this won't break something else..."
Where is this widget? I don't see any kind of a widget for "Order reference"
Comment #10
gdoteof CreditAttribution: gdoteof commentedI am getting
EntityMalformedException: Missing bundle property on entity of type commerce_order. in entity_extract_ids() (line 7633 of /var/www/jv/includes/common.inc).
On a pretty vanilla commerce install (drupal install has a lot going on, but commerce was just enabled).
This error comes up when clicking checkout and trying to enter a coupon.
Comment #11
heshanlkI'm also getting
EntityMalformedException: Missing bundle property on entity of type commerce_order. in entity_extract_ids()
, I've changed the field setting and choose Percentage coupon as bundle, none of the above *dirty* fixes worked for me.Comment #12
farse CreditAttribution: farse commentedYup, this is giving me all kinds of headaches as well.
The field is listed in the fields, but trying to edit it throws the error.
I am also getting an error that the table 'field_data_commerce_coupon_order_reference' doesn't exist (when I try to create an order) and when I checked, yup, the field table doesn't exist.
I tried several times uninstalling (removing all tables and data related to commerce coupon) and installing again. It creates the commerce_coupon and commerce_coupon_type tables fine, but none of the data fields (ie. field_data_commerce_coupon_*).
I was successful once in getting this to work on my staging site (which works on the same version of drupal 7.16 and commerce_coupon 7.x-1.0-beta7 as live)
But when i went to start over from taking a snapshot of live, it just does not want to work.
I am trying to rack my brain all thinking if there's some left over data or something... but dunno any more... only god knows now..
Comment #13
farse CreditAttribution: farse commentedthink I might of found a solution... if you run these two commands (in dev.php or whatever)
commerce_coupon_line_item_configuration();
commerce_coupon_order_configuration(); //especially this one
it should recreate the commerce_coupon_order_reference field if it doesn't exist.
Comment #14
pcambraAs @facine comments, there are a number of workarounds when you're coming from an old version or updating, check this documentation page: https://drupal.org/node/1626506 and this issue for that matter: https://drupal.org/node/1604918
Comment #15
hcderaad CreditAttribution: hcderaad commentedRunning commerce_coupon_order_configuration(); does indeed create the needed reference field on the order, solving this error. Using Commerce Kickstart 2 with Drupal 7.30.