as a followup to #1315022-11: Emptying cart with coupon applied throws error i have a strange behaviour

$coupon = commerce_coupon_load(41);  // id of a valid coupon
dsm($coupon->type); // basic_coupon

$wrapper = entity_metadata_wrapper('commerce_coupon', $coupon);
dsm($wrapper->type); // EntityDrupalWrapper Object
dsm($wrapper->type->value()); // CommerceCouponType Object having property type
dsm($wrapper->type->type);  // error

throws

EntityMetadataWrapperException: Unknown data property type. in EntityStructureWrapper->getPropertyInfo() (Zeile 339 von /home/xl/workspace/einfacherlesen/sites/all/modules/entity/includes/entity.wrapper.inc).

but it should not

Comments

fago’s picture

Status: Active » Postponed (maintainer needs more info)

I've already seen people reporting this, but I cannot reproduce it by using commerce coupon myself. I guess this is caused by an incomplete cache caused by cache-rebuilding issues.

Try inspecting your entity info and entity property info caches and check whether they are complete.

roynilanjan’s picture

Issue summary: View changes

Hi @fago, it seems very generic issue for the entity API + Cache, for my case

- Once a og(organic group) is associated with a node
- Now clear the cache
- Node view page breaks as *Unknown data property type*, now if I check from console for this particular
node id as *drush eval "print_r(entity_metadata_wrapper('node',node_load([nid]))->getPropertyInfo())"*
no basic properties nodes are available in the array structure
- now execute *drush registry-rebuild* & *drush cc all* then only can see the all the properties of node for the above snippet

Note: I'm using PHP 5.6.30 version

Is there anything related PHP compiler of this version that cache behaves inconsistently & breaks the registry as well.
But in my lower environment(PHP-5.3) that doesn't have such issue.

Regards,
Nilanjan

roynilanjan’s picture

Priority: Normal » Critical
Status: Postponed (maintainer needs more info) » Needs work