The entityreference_field_widget_form function fails when the target entity of a field no longer exists. It ends with the exception
Missing bundle property on entity of type node. in entity_extract_ids() (line 7721 of /data/development/drupal/wwffundraising/includes/common.inc
which is caused by calling the EntityReference_SelectionHandler_Generic->getLabel function with a NULL value as the $entity argument.
I ran into this when a customer deleted some nodes that he thought were no longer in use. Unfortunately they were still in use and with this error it is/was impossible to fix the entity containing the reference since the edit form failed to render.
I have attached a very simple and specific fix for this issue. It could certainly be improved upon but at this point I think the safest thing to do is to just let the user know that the referenced entity is missing.
Comment | File | Size | Author |
---|---|---|---|
missing-target-entity.patch | 722 bytes | getu-lar | |
Comments
Comment #1
MustangGB CreditAttribution: MustangGB commentedIs this still an issue in the latest version?
Comment #2
MustangGB CreditAttribution: MustangGB commented