Reviewed & tested by the community
Project:
Salesforce Suite
Version:
5.1.x-dev
Component:
salesforce_mapping.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Aug 2023 at 21:55 UTC
Updated:
29 May 2026 at 15:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
aaronbauman\Drupal\salesforce_mapping\SalesforceMappingFieldPluginBase::pushValue is supposed to handle this, so let's consider this a bug.
Also, see past discussion on #3122412: Mapped date fields are not properly syncing data.
Comment #3
mariacha1 commentedShoot, I didn't find that open issue! That's the same issue as this one in my opinion, although the patches there only deal with pushing. @AaronBauman I'm fine with closing this as a duplicate and moving patching over to there, if it's ok to also work on pulls in that issue too?
Comment #4
aaronbaumani think it's fine to keep both issues open, as that one has a lot of baggage already and is tagged on 4.x
Comment #6
keopxI created the patch to transform SF date to the timestamp for created/changed value.
Comment #10
aaronbaumanLooping back around on this one.
AFAIK this MR addresses an impossible scenario - a "datetime" field from salesforce whose data is getting pulled as an integer.
Salesforce stores datetime values as strings in iso8601 format, which is what the current
\Drupal\salesforce_mapping\SalesforceMappingFieldPluginBase::pullValuemethod checks for.Maybe what we want is for the module to be aware of the Drupal field type and cast an integer value from Salesforce accordingly. That's a much bigger can of worms (ie. what other mis-matched field types do we want to support?), and not addressed by this MR as best I can tell.
Comment #11
knyshuk.vova commentedThe attached patch adds timestamp value push support by converting timestamp into supported by Salesforce format.
The code originally from the last patch in old discussion branch https://www.drupal.org/project/salesforce/issues/3122412#comment-14116705 ,
additionally fixed bugs
- 'date' salesforce type converting
- possibly missing requested drupal field definition (due to 'drupal_field_value' may have not a drupal field name value)
Tests coverage still needed, not included in this patch, but some tests (not all) exists in old discussion branch.
Comment #12
nnevillWorks with 5.1.1.
Thanks!
Comment #13
scott_euser commentedConfirmed yeah, we have been using this patch successfully for some time and it resolves the error when mapping to a date field. Thank you!
Comment #14
aaronbaumanPatch from #11 appears to be a different approach from the MR.
Please reconcile these features and update the MR.
Comment #19
scott_euser commentedPatch from #11 definitely the correct one that solved the issue. Updated issue fork and MRs, cleaned up old MRs. No actual code change from me here, directly applied patch so going back to RTBC rather than NR. Thanks!
Comment #20
scott_euser commentedUpdated test coverage to expect iso 8601 date format per SF docs: https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightni...