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.
I'm trying to trace down why this token is giving errors:
Notice: Undefined index: description in metatag_token_info() (line 29 of /drupal/sites/all/modules/contrib/metatag/metatag.tokens.inc).
Comment | File | Size | Author |
---|---|---|---|
#12 | metatag-n2903980-12.patch | 417 bytes | DamienMcKenna |
|
Comments
Comment #2
Chris CharltonNo thoughts?
Comment #3
DamienMcKennaWhat token are you using?
Comment #4
Chris CharltonI assumed the "description" token was the standard
<meta name="description" ... >
. Is there something I can do on my end to get the token's origin [module]?Comment #5
DamienMcKennaWhich "description token" are you talking about? :) What's the actual string you're filling into the field?
Comment #6
Chris CharltonI'm using a Node Teaser/Summery token for 'description' META tag. Some nodes don't have a summary (on purpose), and some nodes don't have a Body field but I thought that would be harmless.
Comment #7
DamienMcKennaSo you're saying that the token is "[node:summary]"?
That line in the tokens.inc file has nothing to do with "description" meta tags, it is the meta tag's form field description, which are defined in hook_metatag_info(). So this means there's a meta tag defined on your site which does not have a description defined.
Do you have any custom meta tags defined?
Comment #8
Chris CharltonNo, none; I wouldn't be surprised it was a contrib module. Now that I understand "description" isn't the META tag but instead a property I'll know what to look for. I'll report back.
Comment #9
Chris CharltonI may have found a clue. I added a check for undefined 'description' in `metatag.token.inc` and devel found this:
schema_item_list.itemListElement
A grep didn't find anything, so I'm still investigating.
Comment #10
Chris CharltonFound the issue lying in the 'schema_metatag' addon module. I opened a ticket over there: #2911680: Description property missing for schema_item_list.itemListElement.
Comment #11
DamienMcKennaThanks for digging into this. This error still shouldn't happen, so lets fix it.
Comment #12
DamienMcKennaThis should fix the error.
Comment #14
DamienMcKennaThanks for digging into this, Chris!
Comment #15
DamienMcKennaComment #16
Chris CharltonYep! I was going there too.
I spent time yesterday trying to determine if the 'description' property was documented as a required property for the hook. Technically, that property is not labeled as required in the documentation/comments (nor is label). This check will help any loose implementations.