Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
fagoI'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.
Comment #2
roynilanjan CreditAttribution: roynilanjan commentedHi @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
Comment #3
roynilanjan CreditAttribution: roynilanjan commented