date_parse error

dsellers154 - June 26, 2009 - 15:40
Project:Event
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)
Description

I posted this to a closed thread so am re-posting to open it up.

I am getting this error in preview and when I submit, no event is saved.

warning: date_parse() expects parameter 1 to be string, array given in /home1/xxxxxxx/public_html/modules/event/event.module on line 2785.
warning: date_parse() expects parameter 1 to be string, array given in /home1/xxxxxxx/public_html/modules/event/event.module on line 2785.

function event_explode_date($date) {
if (function_exists('date_parse')) {
$date = date_parse($date); <<<======LINE 2785
$return = array();
$return['year'] = $date['year'];
$return['month'] = str_pad($date['month'], 2, '0', STR_PAD_LEFT);
$return['day'] = str_pad($date['day'], 2, '0', STR_PAD_LEFT);
$return['hour'] = str_pad($date['hour'], 2, '0', STR_PAD_LEFT);
$return['minute'] = str_pad($date['minute'], 2, '0', STR_PAD_LEFT);
$return['second'] = str_pad($date['second'], 2, '0', STR_PAD_LEFT);
return $return;
}
else {
list($date, $time) = explode(' ', $date);
// make it work for "time only" and "date only" values as well
if (!isset($time)) {
if (strpos($date, '-') ) {
$time = '00:00:00';
}
else {
$time = $date;
$date = '--';
}
}

list($year, $month, $day) = explode('-', $date);
list($hours, $minutes, $seconds) = explode(':', $time);
return array('year' => $year, 'month' => $month, 'day' => $day, 'hour' => $hours, 'minute' => $minutes, 'second' => $seconds);
}
}

Any Ideas?

#1

dsellers154 - June 26, 2009 - 16:28

so, to ellaborate... the events are in fact saved to database, and it is important to publish them to be able to view them. I am still however getting the error on preview.

#2

killes@www.drop.org - June 28, 2009 - 10:44
Status:active» postponed (maintainer needs more info)

Can you check from which function event_explode_date is called when this happens?

#3

dsellers154 - June 29, 2009 - 14:27

I am not sure how.. What would i need to do to get this info?

#4

killes@www.drop.org - June 30, 2009 - 07:40

you can install devel.module and put the following before the date_parse call:

if (is_array($date)) ddebug_backtrace();

this shoudl give you a traceback.

 
 

Drupal is a registered trademark of Dries Buytaert.