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.
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().
Comment | File | Size | Author |
---|---|---|---|
#2 | allow_view_tokens.patch | 656 bytes | Dasha_V - old |
allow_view_tokens.patch | 1.77 KB | Dasha_V - old | |
Comments
Comment #1
Dasha_V - old CreditAttribution: Dasha_V - old commentedComment #2
Dasha_V - old CreditAttribution: Dasha_V - old commentedNew patch with fixes after additional testing other metatags pages
Comment #3
Dave ReidI 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.
Comment #4
Dave ReidAlso 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.
Comment #5
Dave ReidRenamed context from 'views' to 'view'.
Comment #6
Dave ReidMoving to the meta tags issue queue to fix metatag.admin.inc.
Comment #7
Dave ReidFixed in 7.x-1.x with http://drupalcode.org/project/metatag.git/commit/a19db4b and will be included in the next Meta tag release.