I'm using a content type which have 3 fields depending on one another. The 3rd field causes an error:
EntityMalformedException : Missing bundle property on entity of type node. in entity_extract_ids() (ligne 7844 .../includes/common.inc).
I've found the lines 512 to 515 of the file reference_option_limit.module are causing the error:
foreach ($entities as $entity) {
list($id, $vid, $bundle) = entity_extract_ids($referred_entity_type, $entity);
$options_limited[$id] = entity_label($referred_entity_type, $entity);
}
Sometimes, this modifies the $entity variable the fonction receives as a parameter.
Renaming $entity solves the problem :
foreach ($entities as $entity2) {
list($id, $vid, $bundle) = entity_extract_ids($referred_entity_type, $entity2);
$options_limited[$id] = entity_label($referred_entity_type, $entity2);
}
Comments
Comment #1
joachim commentedThanks for reporting this, and taking the time to work on a fix.
However, this was already fixed in dev a while back -- just I've not made a release yet. I'll try to get onto that soon!
Comment #2
titapita commentedHello and thank you for the work, I modified the module I received a new message
Warning: Invalid argument supplied for foreach() in reference_option_limit_field_attach_form() (line 420 of /home/vsftpd/sixto_4u5t/sixto_4u5t/sites/all/modules/reference_option_limit/reference_option_limit.module).
Comment #3
jomarocas commented@joachim please update the module from dev to new version, the issue no exist in version dev, thanks
Comment #4
james feng commentedrename $entity Very useful. Thank you for sharing.