No value for most tokens

Created on 25 October 2022, about 2 years ago
Updated 10 April 2023, over 1 year ago

Problem/Motivation

I have been unsuccessful using tokens to output formatted Smart Date field information; all tokens suggested in "browse available tokens" return empty except the default.

One of our use cases is pathauto URL patterns; an event node for a meeting on 25 October 2022 might be given the path /events/2022/10/25/meeting ; however, on our new Drupal 9 site running 3.7.x-dev, the automatic alias is always saved as just /events/meeting.

Steps to reproduce

I created a node of type "event" with a smart date field "when" (field_when), and created a Smart Date format, machine name date_path, for the pattern "Y" (for simplicity). I created an example node titled "Meeting" set for October 25, 2022 at 7:30pm local time.

The URL alias pattern /events/[node:field_when]/[node:title] for the example meeting is rendered as /events/tue-oct-25-2022-730pm/meeting, as expected. No other token appears to work at all. I tried

  • [node:field_when:0:duration]
  • [node:field_when:0:format:date_path]
  • [node:field_when:0:value-custom:Y]
  • [node:field_when:0:value-format:date_path]
  • [node:field_when:0:value]

All are empty and result in the path being saved as /events/meeting. I've also tried outputting various tokens and variations using Display Suite, all also coming up blank.

πŸ’¬ Support request
Status

Closed: duplicate

Version

3.7

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States choster Washington, D.C. USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024