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.
Comment | File | Size | Author |
---|---|---|---|
#6 | metatag-entity-malformed-2071649-6.patch | 797 bytes | ipo4ka704 |
#3 | metatag-n2071649-3.patch | 1.43 KB | DamienMcKenna |
Comments
Comment #1
eelkeblokHere'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.
Comment #2
Simon Georges CreditAttribution: Simon Georges commentedComment #3
DamienMcKennaRerolled, and duplicated for metatag_ctools_render_alter() too.
Comment #4
DamienMcKennaCommitted.
Comment #6
ipo4ka704 CreditAttribution: ipo4ka704 commentedWhen metatag module loads the taxonomy term for the current taxonomy overview page it does not check if the lookup a result is object and passes a potential string value into the "metatag_entity_view" function, when you go to /taxonomy/term/%/%. This will eventually result in an EntityMalformedException: Missing bundle property on entity of type taxonomy_term. I attach a patch.
Comment #8
eelkeblokHi. Thanks for the patch! However, you shouldn't reopen issues that have reached the "Closed (fixed)" status, see https://www.drupal.org/node/156119. This makes a certain amount of sense; the issue has been worked all the way to completion (patch provided, rtbc, reviewed, committed, fixed, marked by bot as "Closed (fixed)"), so any problems found afterwards are essentially new problems. It would be great if you could create a new issue issue and attach your patch to it. You can of course refer to this issue stating it is a follow-up.