Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Using the 7.x-1.8 version of this module with Drupal 7.2 I have run into an issue where the meta tags do not display on taxonomy term pages. After further investigation it appears that the issue stems from line 124
if (isset($meta_item['type']) && menu_get_object($meta_item['type']) != $meta_item['entity']) {
continue;
}
At this point $meta_item['type']
is the string 'taxonomy_term' and $meta_item['entity']
is an object. When you run menu_get_object($meta_item['type'])
it returns nothing making the != condition be met and the continue skips adding of the fields. I have checked this using a built in theme and I see the same results.
Comment | File | Size | Author |
---|---|---|---|
#3 | 1188344-git.patch | 856 bytes | valthebald |
#1 | 1188344-no-render-taxonomy-term.patch | 872 bytes | valthebald |
Comments
Comment #1
valthebaldThanks for pointing this out.
Attached patch should solve the problem (can be applied to both 7.x-2.x and 7.x-1.x branches)
Comment #2
blischalk CreditAttribution: blischalk commentedWhen I try and apply the patch previous patch with git apply I get the response:
fatal: patch fragment without header at line 3: @@ -154,12 +154,18 @@ function metatags_quick_page_build(&$page) {
When I compare with other patches I have applied the header section is different. Below is an example from a menu patch I have applied:
diff --git a/includes/menu.inc b/includes/menu.inc
index 007e4a2..2776744 100644
--- a/includes/menu.inc
+++ b/includes/menu.inc
Was this patch created with git diff???
I can make the changes from the patch manually but it is odd that it doesn't apply correctly for me.
Comment #3
valthebaldActually, no - I was out of the git reach.
Attached please find git-formatted patch. I consider this pretty major bug, so I will release 1.9 today