Closed (fixed)
Project:
Token
Version:
6.x-1.11
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
21 Sep 2008 at 16:47 UTC
Updated:
20 Mar 2010 at 17:20 UTC
Jump to comment: Most recent file
The value should be set to "small" as shown below =>
" $type The format to use. Can be "small", "medium" or "large" for the preconfigured date formats. If "custom" is specified, then $format is required as well."
Above taken from Drupal API.
But even when set to small, the year is somehow omitted and upload fails.
Any chance for a fix.
Thanks
Stephen
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 311422_format_date_small.patch | 2.43 KB | greggles |
Comments
Comment #1
spjsche commentedI have changed the Priority status to "critical".
Comment #2
gregglesA patch would move this forward faster than setting it to critical.
How does this patch look?
Comment #3
spjsche commentedI do apologise, I thought only the maintainers are allowed to implement patches and review any code concerned.
But thank you for the advice, and I will do so in the future.
Oh and I will implement your patch and test it.
Thanks
Stephen
Comment #4
greggles@spjsche - thanks for testing this. Here are some book pages about finding/fixing bugs in Drupal:
Patches - http://drupal.org/patch
Getting bugs fixed/good issue reports: http://drupal.org/node/73178
Comment #5
spjsche commentedThanks for the excellent pointers, and apologies again.
Regards
Stephen
Comment #6
spjsche commentedI have implemented the patch, but when I use the "Token" values of "[yyyy]/[mm]/[dd]" to use with
the "Filefield" CCK module I now get a directory structure of "yyyy/mm/dd" and not "2008/10/16" as I had hoped.
I will investigate further.
Thanks
Stephen
Comment #7
spjsche commentedThe use of [site-date] should resolve to a file structure of (in my case UK date format) "17/10/2008".
But the result is only "17/10" the year is missing
The functions only work in the "Public" upload mode and not "Private" but that is something else, I will investigate further and determine if the issue is with the "Token" module.
Thanks
Stephen
Comment #8
spjsche commentedI have changed the token.module as follows =>
- $values['site-date'] = format_date(time(), 'small', '', variable_get('date_default_timezone', 0));
+ $values['site-date'] = format_date(time(), 'custom', 'Y/m/d', variable_get('date_default_timezone', 0));
and everything works a treat both in the "Public" and "Private" upload methods.
I will try and figure out the why it works when I install some debugging tools on my laptop.
Thanks
Stephen
Comment #9
dave reidPatch in #2 looks great.
Comment #10
dave reidFixed in CVS thanks!
http://drupal.org/cvs?commit=337852