hello,

there is an error on node save.

warning: array_key_exists() [function.array-key-exists] The second argument should be either an array or an object in sites/all/modules/date/date/date_elements.inc on line 48.

CommentFileSizeAuthor
#7 date_elements.inc-324290-7.patch774 bytesmarkus_petrux
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anandaberry’s picture

If anyone takes this on, I experimented a little and discovered that this is true on a Drupal 6 release with PHP 5 ONLY in the case of using date as the type of field in the CCK, and NOT in the case of using timestamp. When I used timestamp it went back to working, but when I had a field with date not only did it send the above error, but it would not hold or display the date at all. When I went back to edit the page the date was gone.

pitxels’s picture

Having the same problem

pitxels’s picture

I was using "select list with repeat options" on the widget type, but I changed to "select list" and problem gone.

Lucky, I don't need any repeat options

agent16’s picture

We are seeing this warning as well, with the following setup and other symptoms:

The subject warning appears twice at the point of saving a content node of type 'Event'

PHP 5.2.6
Drupal 6.6
Modules in question were updated (wisely or not) to the latest 6.x dev revisions, as per the suggestion at http://drupal.org/node/262064
as of today (10/27/2008)
View of type Calendar, filter of node type 'Event'
Problem occurs irrespective of the type of date field chosen (date, datetime, datestamp) in CCK
Problem occurs irrespective of choice of Widget Type (select list or text field)

Symptom: content_type_event.field_start_date_value and content_type_event.field_end_date_value are not persisting the values entered when creating content of type 'event'. Probably not coincidentally, the start and end dates do not display when viewing the actual event node (not even the labels for them) - although content-creation preview mode looks sane.

No entirely sure that this is all about the Date module(s) - clearly, other things are involved: Views, CCK, Calendar...

We have time/motivation/resources to work on this, if anyone can give meaningful assistance.

Thank you.

GiorgosK’s picture

Status: Active » Postponed (maintainer needs more info)

Someone has to give step by step instructions on how this can be replicated by the developers
only then they can test and correct the problem

KarenS’s picture

There is a new release out today for both Date and Calendar. Please upgrade to it and see if you still have problems.

markus_petrux’s picture

Hi all,

It happened to me as well. The problem is located in function _date_field_update(), that it could receive an empty list of items, which is possible when using multiple values, and all items are empty.

The attached patch fixes the issue.

markus_petrux’s picture

Status: Postponed (maintainer needs more info) » Needs review
markus_petrux’s picture

Version: 6.x-2.0-rc4 » 6.x-2.0-rc6

Opps! Sorry for double posting.

KarenS’s picture

Well I haven't found any way to replicate the situation, but the logic makes sense and shouldn't create any problems if $items is not empty, so I'm committing it. Thanks!

KarenS’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

amitpatel049’s picture

i got the warning like ........warning: array_key_exists() [function.array-key-exists] The second argument should be either an array or an object in sites/all/modules/date/date/date_elements.inc on line 550. what can be the reason?

yogesh1110’s picture

Have you got any soluction for this issue. As I also have the same problem. Please help me out on this.