Problem/Motivation

Entity tokens are not replaced with values on push.

Proposed resolution

Fix Drupal\salesforce_mapping\Plugin\SalesforceMappingField\Token::value().

Remaining tasks

  1. Fix Drupal\salesforce_mapping\Plugin\SalesforceMappingField\Token::value() (done)

Comments

chrisolof created an issue. See original summary.

chrisolof’s picture

Assigned: chrisolof » Unassigned
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new13.27 KB
new1.1 KB

Patch attached.

Token is expecting the entity type as the key in the $data array. Prior to this patch we were providing the namespaced class name, which doesn't work:

xdebug output

chrisolof’s picture

Assigned: Unassigned » chrisolof
Status: Needs review » Needs work

Not 100% yet. When a value doesn't exist for a token (say the Drupal field is empty) the token (like "[node:field_website:uri]", for example) is being pushed. It looks like there's a "clear" option we can pass to token's replace method that will help here - and I think we'll want to make sure we don't push empty strings when we should be pushing NULL. Updated patch in the works...

chrisolof’s picture

Assigned: chrisolof » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.39 KB
new1011 bytes

Updated patch attached. Needs review.

  • aaronbauman committed e478d0c on 8.x-3.x authored by chrisolof
    Issue #2972818 by chrisolof: Entity tokens not replaced with values on...
aaronbauman’s picture

Status: Needs review » Fixed

Looks good - committed e478d0c

Thanks

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.