The salesforce_webform submodule is an excellent add-on, and arrived just in time for my project. It would be a great addition to handle fields that are entity references (fields that support the WebformEntityTrait) akin to how the related elements field from the main part of the suite so that the SFID of mapped fields gets sent instead of the Drupal ID.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

acrosman created an issue. See original summary.

acrosman’s picture

I'm happy to work on getting this started, but I'm looking for feedback on whether this should be handled as a separate plugin entirely or if it should be included as part of the existing plugin and just detect the trait and search of a map. Left to my own devices I'm inclined toward to separate plugin.

acrosman’s picture

Title: Remove describe calls from webform field value method » Related Webform Entity Field Support

Fixed totally incorrect title.

acrosman’s picture

Initial patch attached. Provides a second webform field mapping plugin to handle webform module's entity plugins. Right now it detects them via naming convention, which seems less than ideal but works on the webform core element just fine.

acrosman’s picture

Status: Active » Needs review
AaronBauman’s picture

Status: Needs review » Needs work

Looks like this should implement getDependencies and isAllowed to add conditionality on webform_entity module
See \Drupal\salesforce_mapping\Plugin\SalesforceMappingField\PropertiesExtended for example

acrosman’s picture

FileSize
4.28 KB

Updated patch to include dependency checking. Also fixes an issue with entity autocomplete fields getting skipped for mappings.

acrosman’s picture

Status: Needs work » Needs review
AaronBauman’s picture

Here's an updated version with changes from #3065470: getConfigurationOptions should return all the element for the webform

Also, now that I'm looking more closely, why are we doing this in ::value()?

    $element_parts = explode('__', $this->config('drupal_field_value'));
    $main_element_name = reset($element_parts);

I'm guessing this is cruft from 7.x, but let me know if you know a reason we should keep it.

AaronBauman’s picture

Version: 8.x-3.x-dev » 8.x-4.x-dev
FileSize
4.29 KB
1.41 KB

and the patch

AaronBauman’s picture

Component: Miscellaneous » salesforce_webform.module

  • AaronBauman committed c9ee013 on 8.x-4.x authored by acrosman
    Issue #3047748 by acrosman, AaronBauman: Related Webform Entity Field...
AaronBauman’s picture

Status: Needs review » Fixed

This is in

Status: Fixed » Closed (fixed)

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