I have created two new mapping plugins to cover some use cases we have.
The first allows mapping of constant values to drupal entity properties. It is very similar to the existing Salesforce constant mapping.
The second allows for mapping between strings in salesforce and taxonomy reference fields in drupal. We needed to map an existing select list to terms. The plugin queries terms based on the name and creates a term if it can't find one.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kbentham created an issue. See original summary.

kbentham’s picture

AaronBauman’s picture

Status: Needs review » Needs work

This is great, thanks for the patch.

The drupal constant plugin looks good.

Just one suggestion on the taxonomy term plugin: let's make sure to limit the loadByProperties query by vocab from field settings

+    // Look for a term that matches the string in the salesforce field.
+    $terms = \Drupal::entityTypeManager()
+      ->getStorage('taxonomy_term')
+      ->loadByProperties(['name' => $value]);
+    $term_id = key($terms);
kbentham’s picture

Status: Needs work » Needs review
FileSize
9.53 KB

I have updated the taxonomy query to include the vocabs. Thanks for the feedback!

  • AaronBauman committed 46a8aec on 8.x-4.x authored by kbentham
    Issue #3060288 by kbentham: Mapping plugins for drupal constants and...
AaronBauman’s picture

Status: Needs review » Fixed

Committed, thanks again for the patch!

Status: Fixed » Closed (fixed)

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