Use the direct method to get the bundle EntityDrupalWrapper::getBundle() instead of through the magic EntityStructureWrapper::__get() since type property is protected in other wrapper cases and throws of the IDE.
I tested and both yield the same results:
$registration = 11;
$registration_wrapper = entity_metadata_wrapper('registration', $registration);
$type_protected = $registration_wrapper->type->value();
$bundle = $registration_wrapper->getBundle();
drush_print($type_protected);
drush_print($bundle);
// 'extended'
// 'extended'| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3016531-4.patch | 1.86 KB | joelpittet |
Comments
Comment #2
joelpittetHere's a patch for the replacements
Comment #3
joelpittetWhoops, that was status not diff. This is a real patch.
Comment #4
chris matthews commentedThe patch in #3 applied cleanly to registration.forms.inc; registration.entity.inc; and registration.module on 7.x-1.x-dev and after testing they both yielded the same results for me as well so changing the status to RTBC.
Comment #7
joelpittetLooks like this was committed, changing status to fixed. Thanks for the review @Chris Matthews!