Closed (fixed)
Project:
Date
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Sep 2010 at 14:48 UTC
Updated:
16 May 2011 at 16:24 UTC
Jump to comment: Most recent file
Comments
Comment #1
karens commentedThat would be great! I haven't had time to look at what has changed in Token.
Comment #2
scotwith1t+1 for token support. seems token has started to stabilize quite a bit. thanks dave and karen, you guys are amazing drupal rockstars. i promise one day soon i am going to learn to code and start helping you guys out some!
Comment #3
rosborn commentedI don't want to seem like I'm pressurizing because I know how hard everyone is working, but is this likely to make it into the module by the time Drupal 7 is released? Thanks for getting the Date Module working so well. I couldn't develop my site in Drupal 7 without it.
Comment #4
karens commentedIt will not make it in unless someone makes a patch. If this is important to you, make a patch. If you don't know how to do it, find someone who does.
Comment #5
andypostWhat kind of integration should be minimal enough to be implemented? I can make it but see no idea hot tokens should operate
Comment #6
LSU_JBob commentedsubscribed. I really need this so I will try and look into the code and get a patch going.
Comment #7
dboulet commentedHas anybody here done enough work on this to post a patch?
Comment #8
dboulet commentedWondering: would this feature depend on the field tokens provided by Token module? See: #691078: Field tokens.
Comment #9
kbond commentedSubscribe
Comment #10
bfroehle commented~
Comment #11
bfroehle commentedAs a start, we'll need to put the token code in
date.tokens.incto conform with the autoload functionality of system_hook_info().As @Dave Reid said, we'll want to take advantage of the existing 'date' token type in core (in system.tokens.inc). This means that we should completely remove date_token.inc and create a new date.tokens.inc.
I've attached a patch which provides date tokens for all date fields. The patch requires the most recent field tokens patch in #691078-92: Field tokens. Additionally, it will require a fix to #1067886: DateObject cannot handle UTC timezone with Unix datestamp before it will work for datestamp fields.
Example replacement token codes are
Comment #12
rhlowe commentedSubscribing
Comment #13
karens commentedCommitted this much. You can provide another patch if you have more to add.
Comment #15
mrfree commentedthe committed patch doesn't work here... reading the code I noticed that the suggested
[node:field-xxx:date:medium]syntax causes the variable$type = 'node'so the if conditionif (($type == 'date-field-value') && !empty($data['item']))is always false and however the array$datadoesn't contain any 'item' key but only a 'node' key.Can you please explain the code meaning? :)
Comment #16
bfroehle commentedAre you sure you have that installed?
Comment #17
mrfree commentedYup, I've already applied the patch and a lot of new field related tokens are available now but using
[node:field-xxx:date:medium]results in$type=nodein your function so all your code is simply skipped... or I simply haven't understand how it works yet :)Comment #18
hefox commentedThe token support was temporarily removed in #1103032: Document how to use date tokens.
Note that I only figured this out after 3? 4? hours of trying to get token support to work after seeing this issue that seemed to indicate that it was partially working. Then I looked at the first patch, realized it didn't match the code, and went to repository viewer and saw about that issue.
Comment #19
mrfree commenteds**t!
many thanks hefox, reverting the patch http://drupal.org/files/issues/date-1103032-29.patch do the trick now the bfroehle's patch works
Comment #20
bfroehle commentedOkay, so this is fixed then.