Hi,

Really like how this module makes it easy on the user, glad it’s here :-) It works fine for me when I’m creating new orders on the site, but I’ve also migrated a 4K orders from an Ubercart site. When I try to access any of those from the Orders tab on a user profile page, I get the error below:

EntityMetadataWrapperException: 

Unable to get the data property product_id as the parent data structure is not set. in EntityStructureWrapper->getPropertyValue() (line 438 of /var/www/firealarms.com/public_html/profiles/commerce_deploy/modules/contrib/entity/includes/entity.wrapper.inc). 

Backtrace:EntityStructureWrapper->getPropertyValue('product_id', Array) entity.wrapper.inc:86 
EntityMetadataWrapper->value() entity.wrapper.inc:254 
EntityValueWrapper->value() commerce_rma.module:249 
commerce_rma_new_return_is_possible(Object) commerce_rma.module:220 
commerce_rma_access('create', NULL, Object, Object) call_user_func_array('commerce_rma_access', Array) 
menu.inc:647 _menu_check_access(Array, Array) 
menu.inc:800 _menu_translate(Array, Array, 1) 
menu.inc:1960 menu_local_tasks() 
menu.inc:2256 menu_local_actions() commerce_backoffice.module:34 
commerce_backoffice_views_pre_build(Object) view.inc:932 
view->build(NULL) view.inc:1122 
view->execute(NULL) view.inc:1190 
view->render() eva_plugin_display_entity.inc:300 
eva_plugin_display_entity->execute() view.inc:1343 
view->execute_display('quick_edit_payment') 
eva.module:89 
eva_entity_view_alter(Array, 'commerce_order', NULL, NULL) module.inc:1163 
drupal_alter(Array, Array, 'commerce_order') commerce.controller.inc:419 
DrupalCommerceEntityController->view(Array, 'customer', NULL, 1) entity.module:622 
entity_view('commerce_order', Array, 'customer', NULL, 1) commerce_order_ui.module:352 
commerce_order_ui_order_view(Object, 'customer') call_user_func_array('commerce_order_ui_order_view', Array) menu.inc:527 
menu_execute_active_handler() index.php:21 

Seems this could be related to this EntityMetadataWrapperException: Unable to get the data property type issue, which has a patch, but I haven’t been able to work out if that’s true:

Any pointers would be very welcome!

Comments

thekenshow created an issue.

thekenshow’s picture

I should add that these migrated orders can be viewed and edited on the Admin side, but if I click Create a new return, a similar error occurs:

 EntityMetadataWrapperException: Unable to get the data property product_id as the parent data structure is not set. in EntityStructureWrapper->getPropertyValue() (line 438 of /var/www/firealarms.com/public_html/profiles/commerce_deploy/modules/contrib/entity/includes/entity.wrapper.inc). Backtrace:

EntityStructureWrapper->getPropertyValue('product_id', Array) entity.wrapper.inc:86
EntityMetadataWrapper->value() entity.wrapper.inc:254
EntityValueWrapper->value() commerce_return.module:466
commerce_return_new_configure_line_items(Object) commerce_return.controller.inc:60
CommerceReturnEntityController->create(Array) commerce_return.module:786
commerce_return_new(Object) commerce_return.admin.inc:87
commerce_return_new_order_wrapper(Object) 
call_user_func_array('commerce_return_new_order_wrapper', Array) menu.inc:527
menu_execute_active_handler() index.php:21

Also, that this site has Entity API 7.x-1.6.

thekenshow’s picture

Digging into the order structure in the database, found a couple differences between new and migrated orders:

New orders have order_id == order_number, while migrated orders do not:

Migrated Order

        +----------+--------------+-------------+
        | order_id | order_number | revision_id |
        +----------+--------------+-------------+
        |     5829 | 1371         |        5830 |
        +----------+--------------+-------------+

New Order (tried to resist, couldn’t do it :-)

        +----------+--------------+-------------+
        | order_id | order_number | revision_id |
        +----------+--------------+-------------+
        |     9660 | 9660         |        9670 |
        +----------+--------------+-------------+

New line items have a populated data column, but migrated line items do not:

Migrated line item data column:

a:0:{}

New line item data column:

a:1:{s:7:"context";a:5:{s:11:"product_ids";s:6:"entity";s:19:"add_to_cart_combine";b:1;s:30:"show_single_product_attributes";b:0;s:12:"display_path";s:10:"node/17072";s:6:"entity";a:3:{s:11:"entity_type";s:4:"node";s:9:"entity_id";s:5:"17072";s:28:"product_reference_field_name";s:13:"field_product";}}} 

Given that the data in a new order contains entity_type, entity_id, and product_reference_field_name, that seems like a problem.