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.
It would be great for a lot of different reasons to have YYYY, MM, and DD available as tokens... File's for one could benefit.
Comment | File | Size | Author |
---|---|---|---|
#4 | token-date-d5.patch | 2.92 KB | brunodbo |
#1 | token-date-2.patch | 2.92 KB | emok |
token-date.patch | 1.52 KB | dopry | |
Comments
Comment #1
emok CreditAttribution: emok commentedI agree. But I had previously implemented this using the same kind of date tokens as in token_node.inc, which I think is better than having two different sets of date tokens (you used uppercase letters).
Attached pach applies to version 6.x-1.10, but with adjusted line numbers the same patch works for the 5.x-version.
The help texts about the new tokens (e.g. [site-date-yyyy]) do not appear in pathauto where I use them, but they work if you try to use them.
Comment #2
emok CreditAttribution: emok commentedSorry for changing the title, perhaps better now?
Comment #3
dopry CreditAttribution: dopry commented@emok, nice update... code looks good... maybe we can get a maintainer to check it out...
Comment #4
brunodboI applied the patch to the 5.x-version of token.module (5.x patch attached). I tried the new date tokens with the filefield.module, to create a /files/yyyy/mm/ directory structure. Works great.
Comment #5
dopry CreditAttribution: dopry commented*poke*
Comment #6
ar-jan CreditAttribution: ar-jan commentedWorks great (D6), thanks for the patch. Any idea if it is possible to use the submit date of a node as a token?
Comment #7
ekes CreditAttribution: ekes commentedTested (with token 5.x-1.11) and support the patch.
It's lovely when you think your going to have to write something and you find someone has done it already - cheers!
Comment #8
eaton CreditAttribution: eaton commentedmarking this for commit later -- I'll run it by greggles too, but these make sense and they're good ones to use for directory building,etc.
Comment #9
gregglesSeems quite reasonable to me.
Comment #10
AdrianB CreditAttribution: AdrianB commentedI applied the patch i #4 manually and it works great. (Note to self: learn to patch.)
Comment #11
eaton CreditAttribution: eaton commentedCommitted to the D6 branch -- I'll be applying it to the D5 branch later today. Thanks!
Comment #12
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #13
ksenzeeDid this ever get applied to the D5 branch? I don't see it there but maybe I'm overlooking something.
Comment #14
yan CreditAttribution: yan commentedSame question here. I'm using Drupal 5.x and I can't use node tokens (with imagefield). Has that feature been backported?
Comment #15
yan CreditAttribution: yan commentedOk, answering my own question: I reviewed the 5.x-1.11 version's code and also the 5.x-1.x-dev version's code and found that the patch from #4 hasn't been committed. I also tested the patch against 5.x-1.11 and it seems to work without any problems.
Is there anything that keeps the patch from being committed?
Comment #16
yan CreditAttribution: yan commentedSince more than half a year there is a patch for the 5.x version that works but hasn't been committed. Is there any reason for that?
Comment #17
ckng*bump*
patch not committed for D5 & D6.
Comment #18
yan CreditAttribution: yan commentedBumping this again after three weeks without an answer. Could somebody at least say why the patch still hasn't been comitted for 5.x-1.x?
Comment #19
gregglesThanks @emok and @brunodbo. Now committed to 5.x as well http://drupal.org/cvs?commit=195330
@ckng - the patch is committed to 6.x (see here). It is not in HEAD because eaton prefers not to use HEAD.
@yan - lack of round tuits. You could help increase the number of round tuits by cleaning up the duplicates and support requests in issue queue.
Comment #20
yan CreditAttribution: yan commentedThanks greggles! I'll see what I can do to help out the next time. My problem was that I didn't even know why the patch hadn't been comitted (and I don't know much about developement processes).