My site, which has migration as an import component, was starting to throw server errors when trying to view a taxonomy term page. I was able to trace this back to metatag module and the fact the term ID actually no longer existed (the migration creating it had been rolled back and reran, thus causing the tid to no longer be valid.

When metatag module loads the taxonomy term for the current taxonomy overview page it does not check if the lookup actually had a result and passes a potential NULL value into the Drupal API. This will eventually result in an EntityMalformedException: Missing bundle property on entity of type taxonomy_term. I will attach a patch in a minute.

Files: 
CommentFileSizeAuthor
#3 metatag-n2071649-3.patch1.43 KBDamienMcKenna
PASSED: [[SimpleTest]]: [MySQL] 73 pass(es).
[ View ]

Comments

Title:May try to load entities that no longer existsMay try to load entities that no longer exist
StatusFileSize
new771 bytes
PASSED: [[SimpleTest]]: [MySQL] 73 pass(es).
[ View ]

Here's the patch I quickly rolled. You may test this issue by visiting taxonomy/term/ (before the patch this will cause an internal server error, after the patch you should see however the view is configured to handle incorrect arguments). You will need to enable the Views overridden version of the taxonomy overview, that's what this code is dealing with.

Status:Active» Needs review

Issue summary:View changes
StatusFileSize
new1.43 KB
PASSED: [[SimpleTest]]: [MySQL] 73 pass(es).
[ View ]

Rerolled, and duplicated for metatag_ctools_render_alter() too.

Status:Needs review» Fixed

Committed.

Status:Fixed» Closed (fixed)

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