- πΊπΈUnited States AaronBauman Philadelphia
I'm doing some cleanup on unsupported branches.
Please re-open this issue and update the version to 5.0.x-dev if this issue is still applicable to the latest release.
I came across this issue while syncing User Last Login data with Salesforce.
This issue is applicable on Salesforce 8.x-4.x and 8.x-3.x.
There are essentially 3 problems.
Code that is run
$date = new DrupalDateTime('0', 'UTC');
$value = $date->format(DateTime::ISO8601);
$value is '' and this may runs into validation errors in Salesforce.
[{"message":"Cannot deserialize instance of date from VALUE_STRING value or request may be missing a required field at [line:1, column:373]","errorCode":"JSON_PARSER_ERROR"}]
Code that is run
$date = new DrupalDateTime('', 'UTC');
$value = $date->format(DateTime::ISO8601);
$value is the current timestamp ('now') and this is incorrect data.
Code that is run
$date = new DrupalDateTime('1585167349', 'UTC');
$value = $date->format(DateTime::ISO8601);
You cannont create a DateTime object from a timestamp this way.
This results in a bad Date object and Salesforce returns the following error.
[{"message":"Cannot deserialize instance of date from VALUE_STRING value or request may be missing a required field at [line:1, column:373]","errorCode":"JSON_PARSER_ERROR"}]
I am adding 3 things.
* Handle cases where the field is a timestamp field
* Handle cases where the date value is a timestamp (if it was not a timestamp field)
* Handle cases where the date value is empty() (returns NULL)
* Hanlde any outside cases (returns NULL)
Addendum:
* Handle 0, 0.0, and '0' date values as timestamps instead of emtpy values
Closed: outdated
4.0
salesforce_mapping.module
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I'm doing some cleanup on unsupported branches.
Please re-open this issue and update the version to 5.0.x-dev if this issue is still applicable to the latest release.