I created a webform with a field for time but when I set a default time all I get are these errors:

  • warning: DateTimeZone::__construct() [datetimezone.--construct]: Unknown or bad timezone () in /home/greeleym/public_html/beta/sites/all/modules/webform/components/time.inc on line 111.
  • warning: DateTime::__construct() expects parameter 2 to be DateTimeZone, null given in /home/greeleym/public_html/beta/sites/all/modules/webform/components/time.inc on line 112.
  • warning: DateTime::format() [datetime.format]: The DateTime object has not been correctly initialized by its constructor in /home/greeleym/public_html/beta/sites/all/modules/webform/components/time.inc on line 113.

Has anyone else seen these errors?

Comments

quicksketch’s picture

Status: Active » Fixed
StatusFileSize
new1.08 KB
new1.29 KB

This problem may happen when you use a Timezone that the DateTimeZone class does not recognize, which could be caused by some misconfiguration of the Data module. Do you currently have the Date module installed? I'd suggest checking your Date settings and ensuring you have a site timezone selected.

In any case this patch should suppress the error in the situation of a failure like this. I've committed this patch to both 3.x branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.