I get this error when trying to add two fields (or add a multi-date field) in "Row style: Node - FullCalendar" options:

• warning: date_format() expects parameter 1 to be DateTime, null given in /Users/Cale/Sites/acquia-drupal/sites/all/modules/fullcalendar/fullcalendar.module on line 320.

There are a lot of people with this type of error but not with fullcalendar.module at the end.

319  $attributes['index'] = $index;
320  $attributes['start'] = date_format($attributes['start'], DATE_FORMAT_DATETIME);
321  $attributes['end'] = date_format($attributes['end'], DATE_FORMAT_DATETIME);
322
323  return l($text, $node->url, array('attributes' => $attributes));
}

I had a single date event working fine on one view... and a multi-date (From and To) event working fine on another view... but sometimes I get this error at the top of the calendar view... and I certainly cannot see the two events together on one view. I must not be doing something wrong. Thanks for help

CommentFileSizeAuthor
#5 fullcalendar-1039140-5.patch885 bytestim.plunkett

Comments

calefilm’s picture

Update:

I seem to run into this error message when a field is not inputted yet. Thus, if i created the node but left the field empty. But this error is a little fidgety. Can't quite explain it yet--as it also comes up when I'm using the "From and To" date pop up selection field.

HOWEVER, I cannot get two different date fields operational on the FullCalendar. Even if I have created two separate single-date fields and inputted them correctly...

In My Calendar Row Style Options
Date Fields:

field_single_date_calendar_event
field_additional_dates_cal_event

I only can get the first field to show up on my calendar. I can interchange them but I can't see both at the same time. NOTE: the error doesn't show up when trying to implement this set-up.. because I have gotten rid of the "From and To" option.

Is this abnormal? Or is this normal for FullCalendar at this stage. Thanks again.

tim.plunkett’s picture

Not sure about the issue with an empty field. That could use more testing.

As of right now, the calendar uses the first valid date field. If its a multiple value field, its added once for each. But not once per date field...

calefilm’s picture

ah. Ok, that makes me feel better. Thanks. I can't quite pin down right now when I get the error or why but a number of people have issues with this type of Warning over at date.module http://drupal.org/node/518816

Will update this if I can be of help.

tim.plunkett’s picture

Status: Active » Needs review
StatusFileSize
new885 bytes

calefilm, can you try this patch?

calefilm’s picture

Patch works! Thank you Tim. Got rid of warning. Appreciate it.

calefilm’s picture

Earlier you stated, "If its a multiple value field, its added once for each. But not once per date field..." Do you think down the road we'll be able to add another date field? So that a user can add a date for 'field A' and then add a date for 'field B' and see both fields as a result of creating this node?

tim.plunkett’s picture

That is being worked on in #1036444: Cleanup the views UI + remove autodiscovery mega issue..
Will be for 7.x-2.x first, and 6.x-2.x shortly after.

calefilm’s picture

Thanks for your hard work!

geerlingguy’s picture

Subscribe - just had this on my development server (first time I noticed the message), but I have no clue why it happened. A fresh db restore fixed it.

geerlingguy’s picture

Status: Needs review » Needs work

The patch got rid of the error for me.

geerlingguy’s picture

Status: Needs work » Reviewed & tested by the community

At least it fixes the error - the other error (in my case) occurred between the keyboard and the chair.

tim.plunkett’s picture

Status: Reviewed & tested by the community » Needs work

Yeah, more investigating is in order.

socialnicheguru’s picture

the patch worked for me also.

tim.plunkett’s picture

Status: Needs work » Closed (duplicate)
dribblecastle’s picture

Issue started for me when I switched from a Date to a DateTime cck field.

Patch worked for me as well. Thank you very much!