Hello,

As asked by deshilachado I open a new issue for this bug report : http://drupal.org/node/386406#comment-1338238 (my date fields' default value is blank (not now), and the fields (when not completed) are automatically filled as "2009-01-01...")

Config. is : localhost (Wamp server), Drupal 6.10, php 5.2.8
Date modules enabled : Date API, Date, Date Timezone
CCK version is : 6.x-2.1

datefield code with 2.x.rc6 version of Date module (working properly)

$content[fields]  = array (
  0 => 
  array (
    'label' => 'Date',
    'field_name' => 'field_lettre_date',
    'type' => 'date',
    'widget_type' => 'date_text',
    'change' => 'Change basic information',
    'weight' => '-1',
    'default_value' => 'blank',
    'default_value_code' => '',
    'default_value2' => 'same',
    'default_value_code2' => '',
    'input_format' => 'Y-m-d H:i:s',
    'input_format_custom' => '',
    'advanced' => 
    array (
      'label_position' => 'above',
      'text_parts' => 
      array (
        'year' => 0,
        'month' => 0,
        'day' => 0,
        'hour' => 0,
        'minute' => 0,
        'second' => 0,
      ),
    ),
    'increment' => 1,
    'year_range' => '-3:+3',
    'label_position' => 'above',
    'text_parts' => 
    array (
    ),
    'description' => '',
    'group' => false,
    'required' => 0,
    'multiple' => '0',
    'repeat' => 0,
    'todate' => '',
    'granularity' => 
    array (
      'year' => 'year',
      'month' => 'month',
      'day' => 'day',
    ),
    'output_format_date' => 'm/d/Y - H:i',
    'output_format_custom' => '',
    'output_format_date_long' => 'l, F j, Y - H:i',
    'output_format_custom_long' => '',
    'output_format_date_medium' => 'D, m/d/Y - H:i',
    'output_format_custom_medium' => '',
    'output_format_date_short' => 'm/d/Y - H:i',
    'output_format_custom_short' => '',
    'tz_handling' => 'none',
    'timezone_db' => '',
    'op' => 'Save field settings',
    'module' => 'date',
    'widget_module' => 'date',
    'columns' => 
    array (
      'value' => 
      array (
        'type' => 'varchar',
        'length' => 20,
        'not null' => false,
        'sortable' => true,
      ),
    ),
    'display_settings' => 
    array (
      'weight' => '6',
      'parent' => '',
      'label' => 
      array (
        'format' => 'above',
      ),
      'teaser' => 
      array (
        'format' => 'field_lettre_date_long',
        'exclude' => 0,
      ),
      'full' => 
      array (
        'format' => 'field_lettre_date_long',
        'exclude' => 0,
      ),
      4 => 
      array (
        'format' => 'field_lettre_date_long',
        'exclude' => 0,
      ),
      2 => 
      array (
        'format' => 'field_lettre_date_long',
        'exclude' => 0,
      ),
      3 => 
      array (
        'format' => 'field_lettre_date_long',
        'exclude' => 0,
      ),
      'token' => 
      array (
        'format' => 'field_lettre_date_long',
        'exclude' => 0,
      ),
    ),
  ),
);

datefield code with 2.0 and 2.x-dev versions of Date module (bug on "blank" default value option)

$content[fields]  = array (
  0 => 
  array (
    'label' => 'Date',
    'field_name' => 'field_lettre_date',
    'type' => 'date',
    'widget_type' => 'date_text',
    'change' => 'Change basic information',
    'weight' => '-1',
    'default_value' => 'blank',
    'default_value2' => 'same',
    'default_value_code' => '',
    'default_value_code2' => '',
    'input_format' => 'Y-m-d H:i:s',
    'input_format_custom' => '',
    'advanced' => 
    array (
      'label_position' => 'above',
      'text_parts' => 
      array (
        'year' => 0,
        'month' => 0,
        'day' => 0,
        'hour' => 0,
        'minute' => 0,
        'second' => 0,
      ),
    ),
    'increment' => 1,
    'year_range' => '-3:+3',
    'label_position' => 'above',
    'text_parts' => 
    array (
    ),
    'description' => '',
    'group' => false,
    'required' => 0,
    'multiple' => '0',
    'repeat' => 0,
    'todate' => '',
    'granularity' => 
    array (
      'year' => 'year',
      'month' => 'month',
      'day' => 'day',
    ),
    'default_format' => 'short',
    'tz_handling' => 'none',
    'timezone_db' => '',
    'op' => 'Save field settings',
    'module' => 'date',
    'widget_module' => 'date',
    'columns' => 
    array (
      'value' => 
      array (
        'type' => 'varchar',
        'length' => 20,
        'not null' => false,
        'sortable' => true,
        'views' => true,
      ),
    ),
    'display_settings' => 
    array (
      'weight' => '6',
      'parent' => '',
      'label' => 
      array (
        'format' => 'above',
      ),
      'teaser' => 
      array (
        'format' => 'field_lettre_date_long',
        'exclude' => 0,
      ),
      'full' => 
      array (
        'format' => 'field_lettre_date_long',
        'exclude' => 0,
      ),
      4 => 
      array (
        'format' => 'field_lettre_date_long',
        'exclude' => 0,
      ),
      2 => 
      array (
        'format' => 'field_lettre_date_long',
        'exclude' => 0,
      ),
      3 => 
      array (
        'format' => 'field_lettre_date_long',
        'exclude' => 0,
      ),
      'token' => 
      array (
        'format' => 'field_lettre_date_long',
        'exclude' => 0,
      ),
    ),
  ),
);

Tell me what you need more...
Good luck ! thanks,

Comments

Junro’s picture

suscribe :)

headkit’s picture

i am in

btw: one version before this problem was not there!

mRs-’s picture

same problem here

mikeytown2’s picture

davidhk’s picture

subscribe

extect’s picture

same problem here with latest dev-version.

Junro’s picture

Priority: Normal » Critical

critical because this is really really really critical lol I can't put my site on production with this bug... anyway, I've got another bugs to fix before :)

choster’s picture

Priority: Critical » Normal

"Critical" bugs are those which cause loss of data or render a site unusable.

Junro’s picture

oh ok, didn't know there was a definition to critical :) Thans for this info!

RoboPhred’s picture

suscribe

splashworx’s picture

Same with me. Previous version was working fine but the update reverts to 2009-1-1.

Setting any value to 'now' shows 1-1-2009. 'Now + 7 days' also returns 1-1-2009 regardless of 'days'.

extect’s picture

@splashworx: The issue regarding "now" as default value has been fixed already. Have a look at #386406: After module upgrade, Views filter value "now" incorrectly outputs 2009-01-01

headkit’s picture

@extect: yes, but this issue is about a default value equals blank (not now).
;-)

Junro’s picture

Last dev. version of Date (and CCK) not fixe the problem for me.

karens’s picture

I can replicate the problem, but only using the 'Text' widget. I can't tell if everyone reporting this is using that widget, but the ones that provided enough information seem to be. The problem goes away if you switch to either the 'Select' or the 'Popup' widgets. Working on a fix for this now...

karens’s picture

Status: Active » Fixed

I think I have this fixed in -dev now. Still doing some more testing, but I have committed a fix.

Junro’s picture

Great new! :)

Thanks a lot ^^

Junro’s picture

ok, just test the lest dev. version.

I've still got the problem, but if I take off hte 2009-01-11 from my cck field and i can't save the node, I have this:

warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
There are errors in Année:
The To date must be greater than the From date.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
There are errors in Allemagne (reprise) value #2:
The To date must be greater than the From date.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
There are errors in Allemagne (reprise) value #3:
The To date must be greater than the From date.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
There are errors in Allemagne (reprise) value #4:
The To date must be greater than the From date.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
There are errors in Allemagne (reprise) value #5:
The To date must be greater than the From date.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
There are errors in Allemagne (reprise) value #6:
The To date must be greater than the From date.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
There are errors in Allemagne (reprise) value #7:
The To date must be greater than the From date.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
There are errors in Allemagne (reprise) value #8:
The To date must be greater than the From date.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
There are errors in Allemagne (reprise) value #9:
The To date must be greater than the From date.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
There are errors in Allemagne (reprise) value #10:
The To date must be greater than the From date.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
There are errors in Allemagne (reprise) value #11:
The To date must be greater than the From date.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
There are errors in Allemagne (reprise) value #12:
The To date must be greater than the From date.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
There are errors in Allemagne (reprise) value #13:
The To date must be greater than the From date.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
(many times)

Junro’s picture

I can't save nodes with a CCK date field.

On this node, I just have one cck date field with a value already set (so I don't have 2009-01-01), i've got this:

warning: array_shift() [function.array-shift]: The argument should be an array in /home/pariscin/www/includes/form.inc on line 1320.
There are errors in Année:
The To date must be greater than the From date.

iko’s picture

Status: Fixed » Active

Hello,

the -dev version doesn't fix the problem for me.
I updated CCK to 6.x.2.2

thanks,

aren cambre’s picture

subscribe

karens’s picture

Status: Active » Postponed (maintainer needs more info)

I just committed the fix this morning and I can't tell if you are actually using the code with the fix. If you use the tarball from the project site, you do not have the fix until the tarball gets updated, probably tonight. If you are definitely using the latest code (which is only if you got it directly from cvs and not the tarball) I need to know exactly specifically what kind of date field and widget and settings you are using.

The problem was very specific to a certain combination of settings so without knowing that there is nothing I can do. I need to see all your settings (easiest way is to create an export of the date field using Content Copy). You need to make it clear what you did to test it. Did you go back and re-edit the date field to be sure it is set up correctly and re-save it? Are you seeing an error when creating a new field or editing and existing field? Exactly what date did you try to enter into the field? Etc Etc.

Junro’s picture

oh ok, I'm using the tarball from the profect site, I don't have CVS access.

But I still have the bug describe above:#18 and #19.

"Did you go back and re-edit the date field to be sure it is set up correctly and re-save it?" yes, but can't save it.

Junro’s picture

Anyway, it would be another issue (I will create it if I don't fixe it myself).

So, I will wait the next dev. version for this issue :)

karens’s picture

You will have the bug until you get the fix, so you have to wait for the tarball to update.

Junro’s picture

ok, fixed with the last dev. version :) Thanks! ^^

ps: You have to take off all date fields with 2009-01-01 value yourself.

2009-01-01 is not dissappear automatically.

karens’s picture

Status: Postponed (maintainer needs more info) » Fixed

Yes, if you saved those values you'll have to fix them yourself. I can't do that automatically because I have no way to know if that was the desired date or not.

Junro’s picture

Sure, no problem for me, some 500 fields to erase, not funny time lol but it will be quick!

Thanks again, trully appreciate your work!

iko’s picture

Actually, I used the tarball yesterday (I don't even know what is a CVS !) ; with the new one (03.20.2009), the problem of automatically-filled field is fixed.

But when saving the node (either creating or updating), I can see this warning : "warning: date_timezone_set() expects parameter 1 to be DateTime, null given in C:\wamp\www\...\sites\all\modules\date\date\date_token.inc on line 43."

I don't know what it means (do I have to do something... ?) : I was wondering whether it was related to my field's settings (in particular the Time zone handling, which I set to No time zone conversion), but I don't see the warning when I fill the date field. Do you have an idea ?

Anyway, thanks a lot for the fix !!

karens’s picture

The last issue is #408176: Date token error. Working on a fix for that in the other issue.

Junro’s picture

CVS is a dev. version for devellopers only (with restrict access), dev. version where they worked with. (pas du très bon anglais ça je pense lol).

For the timezone warning, I don't know, I don't have it.

iko’s picture

ok, thanks KarenS !

headkit’s picture

@Junro:
the fastest way is to fix the 500 dates directly in your database. use something like


UPDATE `your_databasename`.`content_type_with_date_field` SET `field_name_of_date_field_value` = NULL WHERE `content_type_with_date_field`.`field_name_of_date_field_value` =  '2009-00-00T00:00:00';

Junro’s picture

hum, yes it will be faster, just didn't think about it. Thanks ^^.

karens’s picture

If you fix them in the database, be sure to empty the cache_content cache so you don't see the old values when you view the nodes.

headkit’s picture

after updating, deleting the date from one of the date fields set to blank in the settings and re-saving the node i had the message
"warning: date_timezone_set() expects parameter 1 to be DateTime, null given in ...\sites\all\modules\date\date\date_token.inc on line 43."
when i re-open again, the field is empty but that message comes back when i save the node.

karens’s picture

That is already reporting in another issue and I fixed it this morning, see #30. Unless you updated your code directly from cvs a couple minutes ago, you don't have those fixes.

Junro’s picture

@headkit & Karens

I've done with my database.

Thanks for all these informations, it will be very helpful for others guys in the same situation.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.