I upgraded to dev version to fix this issue: http://drupal.org/node/409476 , so I'm using a custom date format display.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /.../modules/date/includes/date_api_argument_handler.inc on line 234.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /.../modules/date/includes/date_api_argument_handler.inc on line 234.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /.../modules/date/includes/date_api_argument_handler.inc on line 234.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /.../modules/date/includes/date_api_argument_handler.inc on line 234.
After ( successfully) creating the content, I get:
* warning: date_timezone_set() expects parameter 1 to be DateTime, null given in /.../modules/date/date_api_ical.inc on line 568.
* warning: date_format() expects parameter 1 to be DateTime, null given in /.../modules/date/date_api_ical.inc on line 654.
* warning: date_timezone_set() expects parameter 1 to be DateTime, null given in /.../modules/date/date_api_ical.inc on line 568.
* warning: date_format() expects parameter 1 to be DateTime, null given in /.../modules/date/date_api_ical.inc on line 654.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /.../modules/date/includes/date_api_argument_handler.inc on line 234.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /.../modules/date/includes/date_api_argument_handler.inc on line 234.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /.../modules/date/includes/date_api_argument_handler.inc on line 234.
* warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /.../modules/date/includes/date_api_argument_handler.inc on line 234.
On the calendar view, I get the same. It is also displaying dates for the same content twice. That may have been introduced by a recent upgrade.
Thanks for all your work,
glass.dimly
Comments
Comment #1
binford2k commentedI get the same, but viewing the content or calendar seem to work fine. The error only appears in the edit view interface.
Comment #2
binford2k commentedI take it back. Somehow the date popup module was uninstalled when I upgraded to -dev.
Comment #3
jsimonis commentedWe're getting the same thing. Just upgraded to the dev version and we're getting those errors as well. There's a whole list of this error on our calendar page.
Here's my list:
Comment #4
karens commentedCheck your modules page to be sure all your modules are still enabled. I'm getting sporadic reports that some modules got disabled during an update.
Comment #5
vince_pl commentedwarning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /trening/modules/date/date/date_elements.inc on line 544.
any idea to fix this? I tried last stable 6.x-2.4 and 6.x-2.x-dev with no success, still the same error, i use the Date module with cck and flexifield modules
Comment #6
OliverColeman commentedAs a work around until this gets fixed properly this seems to work:
Change the following lines in the function date_widget_validate in date/date/date_elements.inc (around line 544):
$field = $form_state['#field_info'][$element['#field_name']];
if (module_exists('date_repeat') &&
isset($form_values[$field_name]) &&
array_key_exists('rrule', $form_values[$field_name])) {
require_once('./'. drupal_get_path('module', 'date') .'/date_repeat.inc');
(the first line and last line are for context).
This dispatches with the error messages when adding a new user and doesn't seem to have bad side effects (ie the hidden fields can be updated properly at a later date).
I'm guessing this is related to #705486: CCK3 and Content Profile module (new registrations).
Comment #7
bneel commentedI have the same pb with #6
Any news ?
B
Comment #8
nikunjkotechaI am having the same problem
I added is_array condition in between, and it's working for me right now
The line 544 now looks like:
if (module_exists('date_repeat') && is_array($form_values[$field_name]) && array_key_exists('rrule', $form_values[$field_name])) {
Comment #9
thekevinday commentedI have the same problem as #8.
In my case this happens with: CCK-3 with multigroup/fieldgroups.
When a date field is placed inside a multigroup field and the form gets submitted the value of the date field gets set to NULL.
(due to a bug in multigroups)
Putting core CCK fields, such as a text field inside of the multigroup also gets set to NULL.
The problem is not that multigroups is broken (this is the cause).
The problem is that you are not checking that a particular variable is an array _before_ calling array_key_exists().
Comment #10
thekevinday commentedHere is the fix for #5.
The File:
date/date_elements.incThe Function:
date_widget_validate()The original code simply checks the immediate top-level for form_values for the field by a given name:
The problem is multigroups stores the fields inside of a group field, so searching for something at the top-level that is not there will produce a NULL.
The end result is:
array_key_exists('rrule', NULL)which is obviously bad.The solution:
Walk through each group in
form_valuesand search for the field by the given$field_name.Make sure this is an array and then peform the array_key_exists() test case.
Comment #11
karens commentedSo is everyone who is seeing this using multigroups with CCK3? If not, there really is not enough information to be able to reproduce the problem (which is the only way I can be sure of the right fix).
I understand the logic of the patch in #10, it would be nice to get some confirmation from anyone else that it fixes their problems. It is also important to have a list of steps to reproduce the problem.
Comment #12
johnjolowe commentedI'm getting the same error message using FlexiField 6.x-1.0-alpha5 and CCK 6.x-2.8. The FlexiField contains a datetime field and is used in a content-profile (6.x-1.0.) The error occurs when I save the profile.
warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in {...path...}/sites/all/modules/date/date/date_elements.inc on line 540.
Comment #13
Macronomicus commentedYay #10 works as advertised.
I was experiencing the issue in the same context as #12 (Flexigroup with a date field) threw tons of erros & #10 fixes it AFAICT.
Cheers!
Comment #14
scjv commented# 10 works fine
Comment #15
todd zebert commented#10 worked for me, thanks! (even made the patch manually)
Comment #16
karens commentedCommitted a much simpler fix: