Closed (won't fix)
Project:
Metatag
Version:
7.x-1.x-dev
Component:
Integration with other module
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
10 Feb 2020 at 03:15 UTC
Updated:
10 Apr 2026 at 10:26 UTC
Jump to comment: Most recent
Comments
Comment #2
damienmckennaFirst off, I'm sorry you've ran into this problem.
Metatag isn't responsible for the tokens themselves, do you know what module provides that field? What used the output look like? What does it look like now? Have you tried the latest dev snapshot to see if that solves the problem?
Comment #3
tsmulugeta commentedHi,
So it seems that when I want to get a nested value, it doesn't work. For example [node:field_event_city] works but [node:field-event-city:locality] doesn't.
This is the address field. Locality gives the city (at least that's what it used to give).
Comment #4
tsmulugeta commentedComment #5
tsmulugeta commentedSo any array field like address:city or date:first-value, etc. their metatags don't work for me.
Comment #6
damienmckennaDo you mean the Addressfield module?
Might something else be affecting that content type - do you have any custom implementations of Metatag's hooks, or is the "Token" view mode of that content type customized, are the addressfield settings the same between the different content types? Have you examined the data to ensure the "locality" value is filled in on the example node you're testing?
Comment #7
tsmulugeta commentedYes that module and the issue is for all content types (not just one). Sorry for the confusion about that.
Comment #8
tsmulugeta commentedAny nested value has the problem including the Date module
Comment #9
damienmckennaBy any chance do you have the Token Tweaks module installed?
Comment #10
tsmulugeta commentedNo I don't have the module Token Tweaks installed. So the issue is NOT with all nested tokens. The issue seems to be only with fields I have programmatically altered. The metatags used to work but now don't anymore. I updated my metatag module to the dev version thinking that would fix it but it didn't.
Comment #11
tsmulugeta commentedI make changes to 2 fields (an address filed and a date field) within the function theme_util_form_node_form_alter
Perhaps this is affecting the metatags for these fields? How can I programmatically set the metatag for those fields if perhaps something I'm doing in theme_util_form_node_form_alter is affecting the metatags?
Comment #12
damienmckennaLet's take this up in email..
Comment #13
erwangel commentedThis seems to be an address_field module issue. Looking at hook_tokens_alter, I realized that my 1.3 version of "address field" didn't generate any tokens anymore ($replacements array was empty) ; it used to work in 1.2. Patch #5 of https://www.drupal.org/project/addressfield/issues/3082673 resolved temporarily my use case. I didn't try the dev version.
Comment #14
damienmckennaerwangel: Thank you for spotting that, hopefully it'll help tsmulugeta.
tsmulugeta: Please give the patch in the other issue a try and let us know if it solves the problem for you.
Comment #15
damienmckennaI thank you for your contribution to the Metatag module and the Drupal community as a whole. The D7 version of this module is no longer supported, so I am closing this issue.