warning: date_format() expects parameter 1 to be DateTime, null given
| Project: | Calendar |
| Version: | 6.x-2.2 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Hello,
I saw there was a pretty old thread on this error, and recent posters who tried reopening were maimed and hauled away and told to open a new ticket. I didn't see a new ticket, so here is my own new ticket. :)
A little background, I'm using the latest Open Atrium install of D6 and attempting to update the Case Tracker module with a Date CCK field for "due dates". I have opened a discussion in an Open Atrium thread, as well, but I thought it was probably more a Date+Calendar issue. I thought I can come up with an answer here, and then help people out on the OA thread (there were others who were having difficulty over there, too)
On to the error, and then I'll explain what I did to get it:
warning: date_format() expects parameter 1 to be DateTime, null given in /hsphere/local/home/tevih/proj.headlinercreative.com/sites/all/modules/custom/litecal/litecal_plugin_style_litecal.inc on line 188.
There was an existing Calendar view and I tried adding a new CCK date field to the view when I got that error. Here's what I did:
1. Edited content type "Case" and added new CCK field, Date
2. Edited Calendar view
3. Filters > Node: Type - made sure my content type, Case, was checked off
4. Arguments > Date: Date(Node) - made sure my date field was checked: "OR Content: Due date (field_duedate)"
5. Fields > added "Content: Due date" which was my new Date field
I saved the view and got the above error, and the calendar wouldn't show - White Screen O' Death.
I'm asking this in "Calendar" because my understanding is that the calendar view should work with the Date CCK field, and clearly I'm having an issue with that.
Any help is appreciated! Let me know if I need to include more info. Or if I've said too much....
Thanks

#1
Woops - slight clarification:
I tried with and without my date field listed in the "Fields" section. I figured if it wasn't listed there, at least the title would show up (why relist the date if the case is visibly on the date??). Not listing the date field returned the white screen of death. Listing the date field, however, made all dates disappear from the calendar, even ones utilizing different fields, which had previously been on the calendar.
[edit]
Of course, after 3 hours of trying to figure this out, only after I post an issue do I make any headway. Still not working properly, however, I know why the error was showing up.
The error showed up when I didn't have the field listed. Since I didn't really want to show the field, I simply hid the field from displaying, and the error disappeared.
The issue now, is, that *none* of the dates show up. There are two content types, with different CCK fields, and including both fields in the list of views fields for some reason excludes both content types, since neither has both. I don't get why that is, though - it should show any of those, no?
#2
Since I know longer get the above error which prompted the post, I'll close this and open a new issue. Its too confusing in here