The code assumes the Date (ass an array) will be filled out completely. When it is not, and PHP Notices are being reported, PHP yells like this:

# Notice: Undefined index: month in date_convert() (line 1191 of ...sites/all/modules/date/date_api.module).
# Notice: Undefined index: day in date_convert() (line 1192 of ...sites/all/modules/date/date_api.module).

And so on.

Patch to come.

Comments

vordude’s picture

Status: Active » Needs review
StatusFileSize
new1.28 KB

How to see this bug:

-Build a CCK node type with a Date field that only has Year, Month, Day granularity.

-Create a node of this type. (With Error Reporting turned on, as described here: http://randyfay.com/node/76)

-See the PHP Notices as listed above for Hours, Minutes, and Seconds that are not included in the date field.

vordude’s picture

(and of course I mean *as an array)

manarth’s picture

StatusFileSize
new826 bytes

Not sure about defaulting the day/month to 0 - day and month start from 1.

vordude’s picture

StatusFileSize
new11.44 KB

Just trying to reproduce the current functionality.

I wouldn't add data to non-existent data.

(Granted, a zero is more data than null...but I would say a zero is better than a 1 in this case.)

Attached image is a screenshot of how it's being stored in the database.

Edit: (I realized in the image, I flipped the name of the tables, and was trying to demonstrate the module is already storing a 0 for a portion of a date that's not in use.)

pdrake’s picture

StatusFileSize
new813 bytes

The attached patch resolves these PHP notices and sets the values to NULL so that the behavior of this functions is not altered.

karens’s picture

Status: Needs review » Closed (duplicate)

A fix for this got into the code sometime since this was reported. There must have been a duplicate issue with a patch that got committed. Anyway, it's no longer an issue.