We have this error message:

Warning: DateTime::__construct() [<a href='datetime.--construct'>datetime.--construct</a>]: Failed to parse time string (%date) at position 0 (%): Unexpected character in webform_strtodate() (line 3302 of /home/sites/swdt/web/sites/all/modules/webform/webform.module).

While the signature is

function webform_strtodate($format, $string, $timezone_name = NULL) {

When checking with more detail, i see that %date is being used as $string argument. No idea where %date comes from.
This leads to the situation that cron always fails.

See
http://php.net/manual/en/datetime.construct.php
Actually invalid values lead to script full stop.

I've added a short check in the function that prevents to call new DateTime() without valid parameters.
However this needs deep debugging... Where are those values from?!

Comments

miro_dietiker’s picture

Title: webform_strtodate: $date is %date value » webform_strtodate: $string is illegal "%date" value

better title

quicksketch’s picture

How can I reproduce this problem? When do you get the error?

quicksketch’s picture

Most likely this error is coming from "%date" being set as a default value for one of your components. I'd suggest doing a SQL query on the webform_components table where value = '%date'.

quicksketch’s picture

Status: Active » Fixed
StatusFileSize
new846 bytes
new846 bytes

I've decided to suppress these errors for the time being, as no one wants to get a big red error because some user entered an invalid default date or time. In the future validating the default values would further improve this situation.

Status: Fixed » Closed (fixed)

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