When taxonomy terms are deleted, references to them are not cleaned up by drupal core (see #1281114: Database records not deleted for Term Reference Fields after Term is Deleted).

Therefore, we get exceptions
EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7634 of /opt/drupal/includes/common.inc).
when trying to iterate over them, and content deployments abort.

There are some modules to clean up orphaned taxonomy terms, but I don't think adding them as an dependency and forcing a cleanup before a content deployment wouldn't be a good option.

In my eyes, best thing is just to skip these references (which, in a content deployment, reproduces the dangling pointer on the deployed site). A warning should be logged to give the user the chance to investigate and clean up.

CommentFileSizeAuthor
#1 1920054-1-dangling-references.patch2.63 KBjneubert

Comments

jneubert’s picture

Status: Active » Needs review
StatusFileSize
new2.63 KB

Added a patch for code and test

jneubert’s picture

Issue summary: View changes

error message added

dixon_’s picture

Issue summary: View changes
Status: Needs review » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

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