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).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Chris Charlton created an issue. See original summary.

Chris Charlton’s picture

No thoughts?

DamienMcKenna’s picture

What token are you using?

Chris Charlton’s picture

I 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]?

DamienMcKenna’s picture

Which "description token" are you talking about? :) What's the actual string you're filling into the field?

Chris Charlton’s picture

I'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.

DamienMcKenna’s picture

So 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?

Chris Charlton’s picture

Priority: Normal » Minor
Status: Active » Postponed (maintainer needs more info)

No, 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.

Chris Charlton’s picture

Status: Postponed (maintainer needs more info) » Active

I 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.

Chris Charlton’s picture

Status: Active » Closed (works as designed)
Related issues: +#2911680: Description property missing for schema_item_list.itemListElement

Found the issue lying in the 'schema_metatag' addon module. I opened a ticket over there: #2911680: Description property missing for schema_item_list.itemListElement.

DamienMcKenna’s picture

Status: Closed (works as designed) » Active

Thanks for digging into this. This error still shouldn't happen, so lets fix it.

DamienMcKenna’s picture

Status: Active » Needs review
FileSize
417 bytes

This should fix the error.

DamienMcKenna’s picture

Thanks for digging into this, Chris!

DamienMcKenna’s picture

Status: Needs review » Fixed
Chris Charlton’s picture

Yep! 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.

Status: Fixed » Closed (fixed)

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