Hey,

I'm trying a fresh install:
* Drupal 4.7 CVS : http://drupal.org/drupal-4.7-cvs
* CCK : http://drupal.org/project/cck
* Date module : http://drupal.org/project/date

When submitting data with my CCK form, this error is displayed:
Year must be a number between 100 and 3000
warning: implode() [function.implode]: Bad arguments in c:\xammp\...\modules\date\date.inc on line 1143

Does any can confirm this error ?
Am i using the correct releases of Drupal, CCK and Date because I'm a bit confused with the different CVS-releases ?

Comments

karens’s picture

What version of date and cck are you using? You must use the 4.7 versions of everything.

catch’s picture

I'm using latest 4.7 versions of both modules. Getting the same error.

Have tried various input options. I get the year error even if I don't have year as an input option as well.

On the preview page:

year must be a number between 100 and 3000.

in logs

implode(): Bad arguments. in /home/mysite/public_html/modules/contrib/date/date.inc on line 1143.

Trying to enter something with today's date so definitely between 100 and 3000.

karens’s picture

May be related to http://drupal.org/node/86787, maybe something bad in latest commit. I'm trying it in several installations to see if I can reproduce the error and fix it. Just sit tight, hopefully it will be fixed soon...

karens’s picture

Can you also try the things I suggested in that thread. I feel like you're both probably having the same problem.

karens’s picture

Status: Active » Fixed

I think I found the problem. Grab the latest version of date.module and it (hopefully) will be fixed. Reopen if not.

catch’s picture

alright the new version fixes it if I have

ddmmyyyy granularity.

With:

ddmm - I get the same error.

Also I noticed that filtering as "now" in views, nothing appears even if I've got content entered with that date.

Getting this error now in the view:

array_intersect(): Argument #1 is not an array in /home/mysite/public_html/modules/contrib/date/date.inc on line 1695.
ge in_array(): Wrong datatype for second argument in /home/libcomwww/public_html/modules/contrib/date/date.inc on line 1856.

catch’s picture

Status: Fixed » Active

oops forgot to reopen

catch’s picture

ddmmyyyy granularity: 2006-09-30T00:00:00

ddmm granularity: 1970-10-01T00:00:00

catch’s picture

sorry! long week. ignore last comment.

With ddmmyyyy granularity I get the results posted above in database (both of them).

With ddmm it won't save the node and shows the same error message.

karens’s picture

The year is required, so you can't do ddmm granularity and that's why you're getting a message about the year. The reason for that is that my validation has to make some assumptions about whether the user has input something that might really be a date, and the assumption is if there's no year it is not a date. I'm not sure I understand why you would have a day and month but not a year anyway. I've never run into anything like that.

You shouldn't be getting sql or php errors even if you try to omit the year, it should just tell you must have a year, so I'll have to look into why you're seeing errors. I think I need to catch the problem earlier, when the field is set up.

karens’s picture

Also, and maybe this is the problem, the granularity just indicates how much of the date will be requested in the forma and stored in the database. You can display just the month and day in views if you want, but there is still a year in there (the current year if nothing else).

catch’s picture

OK thanks for the help. I do want to omit the year elsewhere in views filtering, will open another issue for that though. Thanks for fixing the other error so fast, pretty much real time!

karens’s picture

Status: Active » Fixed

Latest commit adds in some checks to keep you from omitting the year in granularity and adds a note that the year is required.

Anonymous’s picture

Status: Fixed » Closed (fixed)