Page MenuHomePhabricator

Wrong date encoding fails some donation messages
Closed, ResolvedPublic1 Estimated Story Points

Description

WD php: Exception: DateTime::__construct(): Failed to parse time      [31;40m [1m[error] [0m
string (@2016/10/04 04:09:37 -0700) at position 5 (/): Unexpected
character in DateTime->__construct() (line 34 of
/srv/org.wikimedia.civicrm/vendor/wikimedia/smash-pig/Core/UtcDate.php).
Exception: DateTime::__construct(): Failed to parse time string (@2016/10/04 04:09:37 -0700) at position 5 (/): Unexpected character in DateTime->__construct() (line 34 of /srv/org.wikimedia.civicrm/vendor/wikimedia/smash-pig/Core/UtcDate.php).
Drush command terminated abnormally due to an unrecoverable error.    [31;40m [1m[error] [0m
Error: DateTime::__construct(): Failed to parse time string
(@2016/10/04 04:09:37 -0700) at position 5 (/): Unexpected character

This seems like a regression, but I was unable to find the original bug.

The problem is probably that we're adding the "@"- prefix to trigger PHP's implicit unix timestamp date parse format, but this wasn't a numeric timestamp.

Event Timeline

awight triaged this task as High priority.EditedOct 6 2016, 10:39 PM

High priority, because it's a fatal error to our import process. (I think this condition should remain fatal, because it's our bug and not a problem with the data itself.)

Change 320719 had a related patch set uploaded (by Cdentinger):
only add @ to dates if is_numeric

https://gerrit.wikimedia.org/r/320719

cwdent set the point value for this task to 1.

Change 320719 merged by jenkins-bot:
only add @ to dates if is_numeric

https://gerrit.wikimedia.org/r/320719