Currently, there are properties for the identifiers pointing to an entity. There should be properties pointing to the entities instead though.
Also see "handling entity references" at http://drupal.org/node/1021466.

Attached patch starts to convert the properties. As a result the generated views fields are renamed though + the relationships are auto-generated, so one would have to remove the existing relationships and go through the default views to search/replace "order_id" references with "order" + the same for coupon_id/coupon...

Comments

thehong’s picture

Applied: 3ea336c. Thank you.

thehong’s picture

Status: Needs work » Fixed
webmasterkai’s picture

Status: Fixed » Needs work

remove the existing relationships and go through the default views to search/replace "order_id" references with "order" + the same for coupon_id/coupon...

thehong’s picture

Assigned: Unassigned » thehong

Fixed, but we need this simple patch for entity module, without this patch, it will add join condition like this if we do not select any bundle:

INNER JOIN commerce_coupon ... WHERE commerce_coupon.type IN ('0', '0').

thehong’s picture

StatusFileSize
new742 bytes

(try attach patch again)

webmasterkai’s picture

Perhaps an issue should be created on the Entity API project to apply the patch?

geek-merlin’s picture

upsi, these patches seemdd to cause a regression at #1315022: Emptying cart with coupon applied throws error
maybe linked a flaw here
@fago, would be nice to do a review there

thehong’s picture

Assigned: thehong » Unassigned
pcambra’s picture

Status: Needs work » Fixed

Coupon->order relationships are now managed by EntityReference.

Marking this as fixed again, thanks!

Status: Fixed » Closed (fixed)

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