Only set the "updated" value when it contains a value

This commit is contained in:
Michael 2018-05-11 10:44:28 +00:00
parent f9c695e78d
commit 79a343a69a

View file

@ -522,7 +522,12 @@ class PortableContact
}
}
$fields = ['updated' => $last_updated, 'last_contact' => DateTimeFormat::utcNow()];
$fields = ['last_contact' => DateTimeFormat::utcNow()];
if (!empty($last_updated)) {
$fields['updated'] = $last_updated;
}
dba::update('gcontact', $fields, ['nurl' => normalise_link($profile)]);
if (($gcontacts[0]["generation"] == 0)) {