Skip to content
Snippets Groups Projects
Commit 6bb03807 authored by mattwire's avatar mattwire
Browse files

Fix deprecated warning in createFromFormat

parent cc7b3c3c
No related branches found
No related tags found
No related merge requests found
......@@ -102,7 +102,7 @@ class CRM_CivirulesPostTrigger_ContactCustomDataChanged extends CRM_Civirules_Tr
foreach ($params as $field) {
if (!empty($field['custom_field_id'])) {
$value = $field['value'];
if ($field['type'] == 'Timestamp') {
if ($field['type'] === 'Timestamp' && is_string($value)) {
$date = \DateTime::createFromFormat('YmdHis', $value);
$value = $date ? $date->format('Y-m-d H:i:s') : NULL;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment