Download & Extend

Token validaiton fails on config edit if the instance context isn't an entity type

Project:Metatag
Version:7.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

Problem

Goto the "Meta tags » Defaults » Views" admin page:
/admin/config/search/metatags/config/views
These errors appear after clicking "Save":

  • The Description is using the following invalid tokens: [view:description].
  • The Title is using the following invalid tokens: [view:title].
  • The Canonical URL is using the following invalid tokens: [view:url].

Proposed resolution

Temporary fix - to patch metatag.module, attached.

Remaining tasks

Need review, need better solution, e.g. move "token types" option to the configuration in the hook_metatag_config_instance_info().

AttachmentSizeStatusTest resultOperations
allow_view_tokens.patch1.77 KBIgnored: Check issue status.NoneNone

Comments

#1

Status:needs review» needs work

#2

New patch with fixes after additional testing other metatags pages

AttachmentSizeStatusTest resultOperations
allow_view_tokens.patch656 bytesIgnored: Check issue status.NoneNone

#3

I think actually #1894880: token_get_entity_mapping() should fallback to the entity type if token type not found is a better solution to fix this in Token module.

#4

Also we should rename the context from 'views' to 'view'. The context should match the same syntax as the other entity types, which are not plural.

#5

Status:needs work» fixed

Renamed context from 'views' to 'view'.

#6

Title:Invalid tokens» Token validaiton fails on config edit if the instance context isn't an entity type
Project:Views metatags» Metatag
Version:<none>» 7.x-1.x-dev
Status:fixed» active

Moving to the meta tags issue queue to fix metatag.admin.inc.

#7

Status:active» fixed

Fixed in 7.x-1.x with http://drupalcode.org/project/metatag.git/commit/a19db4b and will be included in the next Meta tag release.

#8

Status:fixed» closed (fixed)

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