Problem with commerce shipping
I have installed commerce shipping 7.x-1.x-dev along with the shipping method example plugin.
Each time i choose my shipping method and enter my shipping information, at the next step of my checkout form
i get this message EntityMetadataWrapperException: Unknown data property commerce_product. in EntityStructureWrapper->getPropertyInfo().
This module have created a shipping line item with a shipping method field.
This field is locked and if want to add a field somewhere, the shipping method field doesn't appear.
Also if i go to customer profiles->list, the steps that i have made during the checkout process have created a shipping information. When i try to delete this shipping information, i get the same message again.
I searched similar topics in drupal.org but found nothing that can help me.
Any help would be appreciated.
Thanks a lot in advance.


Comments
Commerce Devel and Commerce Repair
One of your entities has lost its product field.
If you install Commerce Devel then it will give you a stack trace that we can use to debug this.
If you've just started with commerce shipping, then please disable it, uninstall it, and reinstall it.
If you still have the problem then, you can use Commerce Repair to put the fields back together. Please make sure to follow the instructions on the project page.
Tested both
Good evening and thank you for your post.
I have installed Commerce Devel and Commerce Repair. The backtrace message that commerce devel produced was :
EntityStructureWrapper->getPropertyInfo('commerce_product') entity.wrapper.inc:385
EntityStructureWrapper->get('commerce_product') entity.wrapper.inc:405
EntityStructureWrapper->__get('commerce_product') commerce_product_key.module:964
commerce_product_key_commerce_cart_order_refresh(Object) module.inc:819
module_invoke_all() commerce_cart.module:795
commerce_cart_order_refresh('commerce_product_key_commerce_cart_order_refresh', Array) commerce_cart.module:496
commerce_cart_commerce_order_load('commerce_cart_order_refresh', Object) entity.inc:334
DrupalDefaultEntityController->attachLoad(Object) commerce_order.controller.inc:119
CommerceOrderEntityController->attachLoad(Array) entity.inc:204
DrupalDefaultEntityController->load('commerce_cart_commerce_order_load', Array) common.inc:7454
entity_load() commerce_order.module:623
commerce_order_load_multiple(Array, ) commerce_order.module:594
commerce_order_load(Array, ) commerce_cart.module:536
commerce_cart_order_load(Array, Array) commerce_cart.module:457
commerce_cart_block_view('commerce_order', Array, Array, ) module.inc:795
module_invoke() block.module:828
_block_render_blocks(Array, Array) block.module:658
block_list('6') block.module:315
block_get_blocks_by_region('1') block.module:268
block_page_build('cart') common.inc:5490
drupal_render_page('commerce_cart_block_view', Array) common.inc:2542
drupal_deliver_html_page('commerce_cart', 'block_view', 'cart') common.inc:2437
drupal_deliver_page() menu.inc:518
menu_execute_active_handler() index.php:21
I also repaired Commerce Fields with Commerce Repair but problem still exists. I only installed the shipping method example that comes along with the commerce shipping module.
Any idea where the problem might be?
Thank you
Line item missing commerce_product field?
It looks to me like the line item is missing the commerce_product field. If you go to admin/commerce/config/line-items/product/fields, is there a commerce_product field?
Commerce Repair should fix this kind of problem... You followed the instructions there right? (And patched commerce?)
Commerce_product field not missing
Hi.
The commerce_product field is not missing inside the line item. Also i have double checked the patch for commerce repair and everything seems ok.
I have only one question. inside the patch for commerce repair
diff --git a/modules/order/commerce_order.module b/modules/order/commerce_order.module
index 16e3526..d8f24cf 100644
--- a/modules/order/commerce_order.module
+++ b/modules/order/commerce_order.module
@@ -136,6 +136,13 @@ function commerce_order_enable() {
* Implements hook_modules_enabled().
*/
function commerce_order_modules_enabled($modules) {
+ commerce_order_configure_order_fields($modules);
+}
+
+function commerce_order_configure_order_fields($modules = NULL) {
+ if (empty($modules)) {
+ $modules = module_implements('commerce_customer_profile_type_info');
+ }
shouldn't be $modules = module_implements('commerce_order_type_info'); ???
Is there a problem in commerce_order fields..?
Now the only way to restore my system is to delete rows from specific tables in my database that are related with the order that generates this error.
Thanks in advance.
Adding profile fields to order
If I'm not mistaken this code (which doesn't change with the patch; it just gets moved into a different function) is adding a profile field to the order for each type of profile field.
Since you grok the code, it's better to put questions like this in the issue queue :-)