$bundle->type is not a dead cert. Some entity types can put the bundle name somewhere else. This is defined in the 'bundle keys' array of https://api.drupal.org/api/drupal/modules!system!system.api.php/function....

Comments

joachim’s picture

Best thing is to use field_extract_bundle().

  • Commit 29fdf12 on 7.x-1.x by joachim:
    Issue #2211007 by joachim: Fixed assumption that a bundle object has a '...
joachim’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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