Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello, I'm getting the following warnings on a fresh Drupal 7 Install with all the latest dev releases of the Views, Date, Ctools, and Calendar modules. I noticed there was a similar issue already posted but it's status is closed. Any help is appreciated.
Notice: Undefined property: stdClass::$field_data_field_trade_show_date_field_trade_show_date_value2 in calendar_build_nodes() (line 687 of /Applications/MAMP/htdocs/drupal_7_test2/sites/all/modules/calendar/calendar.module).
Warning: DateTime::getTimezone() [datetime.gettimezone]: The DateTime object has not been correctly initialized by its constructor in DateObject->__construct() (line 169 of /Applications/MAMP/htdocs/drupal_7_test2/sites/all/modules/date/date_api/date_api.module).
Warning: DateTime::format() [datetime.format]: The DateTime object has not been correctly initialized by its constructor in DateObject->format() (line 238 of /Applications/MAMP/htdocs/drupal_7_test2/sites/all/modules/date/date_api/date_api.module).
Warning: DateTime::format() [datetime.format]: The DateTime object has not been correctly initialized by its constructor in DateObject->format() (line 238 of /Applications/MAMP/htdocs/drupal_7_test2/sites/all/modules/date/date_api/date_api.module).
Warning: DateTime::format() [datetime.format]: The DateTime object has not been correctly initialized by its constructor in DateObject->format() (line 238 of /Applications/MAMP/htdocs/drupal_7_test2/sites/all/modules/date/date_api/date_api.module).
Warning: DateTime::format() [datetime.format]: The DateTime object has not been correctly initialized by its constructor in DateObject->format() (line 238 of /Applications/MAMP/htdocs/drupal_7_test2/sites/all/modules/date/date_api/date_api.module).
Warning: DateTime::format() [datetime.format]: The DateTime object has not been correctly initialized by its constructor in DateObject->format() (line 238 of /Applications/MAMP/htdocs/drupal_7_test2/sites/all/modules/date/date_api/date_api.module).
Warning: DateTime::format() [datetime.format]: The DateTime object has not been correctly initialized by its constructor in DateObject->format() (line 238 of /Applications/MAMP/htdocs/drupal_7_test2/sites/all/modules/date/date_api/date_api.module).
Warning: DateTime::format() [datetime.format]: The DateTime object has not been correctly initialized by its constructor in DateObject->format() (line 238 of /Applications/MAMP/htdocs/drupal_7_test2/sites/all/modules/date/date_api/date_api.module).
Warning: DateTime::setTimezone() [datetime.settimezone]: The DateTime object has not been correctly initialized by its constructor in DateObject->setTimezone() (line 222 of /Applications/MAMP/htdocs/drupal_7_test2/sites/all/modules/date/date_api/date_api.module).
Warning: DateTime::setDate() [datetime.setdate]: The DateTime object has not been correctly initialized by its constructor in DateObject->setTimezone() (line 223 of /Applications/MAMP/htdocs/drupal_7_test2/sites/all/modules/date/date_api/date_api.module).
Warning: DateTime::setTime() [datetime.settime]: The DateTime object has not been correctly initialized by its constructor in DateObject->setTimezone() (line 224 of /Applications/MAMP/htdocs/drupal_7_test2/sites/all/modules/date/date_api/date_api.module).
Warning: date_format() [function.date-format]: The DateTime object has not been correctly initialized by its constructor in calendar_build_nodes() (line 718 of /Applications/MAMP/htdocs/drupal_7_test2/sites/all/modules/calendar/calendar.module).
Comments
Comment #2
acbramley CreditAttribution: acbramley commentedI'm also getting similar errors.
Comment #3
acbramley CreditAttribution: acbramley commentedThese are my errors. I need to use this module without errors for my clients. All I did was clone the calendar view, and change the iCal feed filter to use my date cck field instead of "Updated date"
Comment #4
KarenS CreditAttribution: KarenS commentedCannot reproduce this problem in 7.3.
Comment #5
yelvington CreditAttribution: yelvington commentedI have this problem on 7.x-3.0-alpha1, but what I've noticed is that it's specifically related to nodes that were imported from a csv file using Feeds, and is triggered by Views.
Symptoms:
* Hundreds of errors of the form "Warning: DateTime::format(): The DateTime object has not been correctly initialized by its constructor in DateObject->format()" The date_api.module line numbers vary but most refer to line 241 or 172.
* The imported nodes do not appear in the calendar.
* Individually, the imported nodes seem to display correctly.
* Editing a node, then saving it, seems to fix the problem for that node. It then appears in the calendar view.
Nodes that are created manually are just fine.
All of this makes me wonder whether the dates are being imported in the right format: yyyy-mm-dd hh:mm
I'm reopening this rather than creating a new issue, as the earlier posters may have some insight as to how their nodes were created.
Comment #6
videographics CreditAttribution: videographics commentedFor what it's worth, I'm seeing the same errors and they go away when I disable Calendar 7.x-3.0-alpha1. It's not a clean install but I thought this might be worth noting anyway. I don't have any imported data.
Comment #7
videographics CreditAttribution: videographics commentedCorrection: It seems to persist even with Calendar 7.x-3.0-alpha1 disabled. (missed some watchdog entries)
So, should this be kicked over to the Date module queue?
Comment #8
videographics CreditAttribution: videographics commentedIf one considers #7 and #5, it seems likely that we're both just looking at bad data triggering these errors and the modules involved are just fine in this regard. (Best to get back to testing from clean installs, huh?) Sorry for creating any unnecessary distractions.
But, this does bring up the point that if it's common to find poorly formed data in a particular field (whatever the source), it might be beneficial to try to come up with a graceful way to handling it.
Comment #9
KarenS CreditAttribution: KarenS commentedThis is probably a duplicate of #1366770: Having non-date data in date field breaks cron and most pages. When you force bad data into fields you're going to get bad results. I'm not really sure how much work Date needs to do to 'fix' things when you do that.
Comment #10
kq_sb CreditAttribution: kq_sb commentedSee https://www.drupal.org/node/2902201
Could also be caused by NULL end date (value2).