Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I created a custom token of type 'date-field-value', which does show up nicely in the token browser with all options ('long', 'short', 'raw', etc.) - yet when I generated a token replacement for the end date (for example, ..:to-date:long) there is never a replacement coming through:
$replacements += date_tokens('date-field-value', $date_tokens, $date_data, $options);
All options are setup correctly with valid data for that end date. Same code works fine for a ..:date:long replacement.
Comment | File | Size | Author |
---|---|---|---|
#1 | Token for end date not replaced-1517216-1.patch | 717 bytes | silberling |
Comments
Comment #1
silberling CreditAttribution: silberling commentedThere seems to be a mismatch in date.tokens.inc, where on line 25 it defines the token for the end date as "to-date":
whereas in function date_tokens, it expects the token to be "end-date" on line 58
Once I replaced the "end-date" with "to-date" I get the expected result. Patch attached.
Comment #2
Alan D. CreditAttribution: Alan D. commented