Problem/Motivation
I created 2 mappings. Each of these mappings was configured to map a paragraph (see https://www.drupal.org/project/paragraphs) to a Salesforce object. I'll call these mappings Mapping 1 and Mapping 2.
Mapping 1 was configured for paragraphs of bundle Bundle 1.
Mapping 2 was configured for paragraphs of bundle Bundle 2.
When I went and updated an entity that had references to paragraphs of Bundle 1 and Bundle 2, an exception was being thrown saying:
"Field $name is unknown."
Digging into it, it looked like fields defined in Bundle 1 were trying to be extracted from a paragraph entity of Bundle 2 (which did not have these fields defined).
Proposed resolution
The query to get the mappings for a specific entity type does not account for bundle. This was causing Mapping 1 to run on paragraphs of Bundle 2. Vice versa, Mapping 2 would run on paragraphs of Bundle 1. So we just need to update that query to include the bundle.
Remaining tasks
Will attach a patch. Please review, comment, etc.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | salesforce-properly-extract-entity-bundle-2921712-6.patch | 629 bytes | rvillan |
Comments
Comment #2
rvillan commentedComment #3
rvillan commentedComment #4
rvillan commentedComment #5
rvillan commentedComment #6
rvillan commentedActually, looks like the dev version already attempted to fix it. But it doesn't look like it's correctly extracting the bundle? Patch attached.
Comment #8
aaronbaumanThanks for the patch - this is in.