EntityMetadataWrapperException: Unknown data property commerce_coupon_order_reference. in EntityStructureWrapper->getPropertyInfo() (line 339 of /Users/jonathan/Sites/commerce_kickstart-7.x-1.8/profiles/commerce_kickstart/modules/entity/includes/entity.wrapper.inc).

Using Commerce Coupon 7.x-1.x-dev 22 May, on Commerce Kickstart 7.x-1.8.

Similar to https://drupal.org/node/1594050 but patch https://drupal.org/node/1594050 has been applied within commerce_coupon.module

Disable commerce_coupon (also commerce_coupon_pct and commerce_coupon_ui) allows site to render pages. Uninstall & re-enable seems to clear the error.

Comments

pcambra’s picture

Status: Active » Postponed (maintainer needs more info)

It seems pretty clear to me that if you get

EntityMetadataWrapperException: Unknown data property commerce_coupon_order_reference

means that you don't have that field in your order entity, in fact the issue you refer to creates the field on enable so I'm quite sure that's why it got fixed for you.
Do you have a consistent way to reproduce this with the current version of the module? if so, please detail step by step how to reproduce it, otherwise I'm thinking this is fixed by the update mentioned above.

jonloh’s picture

@jonathan_hunt I had this problem too, which I realise that my client's site is still running on Drupal 7.10. Upgrading it to the latest seems to fix this issue.

bendev’s picture

I have the same issue with a Drupal 7.15 installation.
I have tried beta 5 and dev versions. Both give the same issue

bendev’s picture

After some further searches, I am wondering, could this be due to the fact that I have upgraded form beta4?
I have read the instructions (http://drupal.org/node/1626506) and tried to uninstall and reinstall

EDIT : I could solve the issue by deleting all commerce orders in the backoffice.

firfin’s picture

Status: Postponed (maintainer needs more info) » Fixed

I also experienced this issue. And updating Drupal, commerce and coupon solved it.
Never used beta4 so I didn't need to remove orders and/or uninstall & reinstall like in #4
Seems like 3 of the 4 reports were solved by updating (dunno about jonathan hunt).

Setting to fixed, please re-open if we experience this issue with recent versions of drupal, commerce and coupons.

Status: Fixed » Closed (fixed)

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

bendev’s picture

Status: Closed (fixed) » Needs review

Sorry to reopen this issue. I thaught it was solved but the issue came back as soon as I added a product to the cart. The commerce order is created in the database and I immediatley get the error:

EntityMetadataWrapperException: Unknown data property commerce_coupon_order_reference. in EntityStructureWrapper->getPropertyInfo() ...

The only way I found to make this message disappear is to delete the commerce order created in the database.

So, to summarize, I came to this problem after an upgrade from beta 4.
I have tried several times to uninstall end reinstall commerce_coupon, to clear caches with drush, to delete the reference field manually or with PHP commands or drush ... and I am still experiencing this issue

I looked at the install file of beta 6 and I see in the function update_7004
"// Remove old field and force a new creation, no way to rename it.
// see http://drupal.org/node/1201898
field_delete_field('commerce_coupon_reference');
commerce_coupon_line_item_configuration();"

I tried to perform it manually in the database but couldn't fix it.
At the moment I don't know what else I could try and any suggestion is more than welcome. Unfortunately I can't start from scratch since the site is almost finished besides the coupon feature...
I would really appreaciate if someone could guide me to fix the issue either via the forum, email, IRC or whatever other mean. I will of course share the solution back with the community when it will be fixed...

Thanks already

pcambra’s picture

Status: Needs review » Closed (duplicate)

Please don't reopen issues for these problems, you've got a issue dedicated to these update problems #1604918: Review uninstall/upgrade process from beta4 and a doc page with hints and tips for solving them: http://drupal.org/node/1626506

bendev’s picture

sorry - wrong interpretation of message #5

haggins’s picture

Issue summary: View changes
Status: Closed (duplicate) » Active

Sorry for reopening this old issue. However, I'm not on an upgrade path but have a fresh beta-7 installation. As soon as I created a fixed amount coupon I get the error message:

EntityMetadataWrapperException: Unknown data property commerce_coupon_order_reference. in EntityStructureWrapper->getPropertyInfo() (Zeile 335 von /var/www/mysite/drupal-7.x/sites/all/modules/contrib/entity/includes/entity.wrapper.inc).

haggins’s picture

Status: Active » Closed (duplicate)

Reinstall fixed it