DrupalConstant does not allow entity reference fields

Created on 4 July 2024, 5 months ago
Updated 16 July 2024, 4 months ago

Hello, I am wondering why the DrupalConstant mapping plugin does not allow entity reference fields? I have a few use cases when creating a node from salesforce, I want to assign the same referenced entities to every node. I am going to extend the plugin to allow this, but I wanted to understand why this is not an option, as I think it adds value to the module, and in my tests you don't need to change any code when saving the value.

Removing these lines:

      // Entity reference fields are handled elsewhere.
      if ($this->instanceOfEntityReference($instance)) {
        continue;
      }

Am I missing something? Will removing this and adding constants to ER fields break something?

EDIT:
I've realised it's a private method, so I cannot easily extend it.

Feature request
Status

Needs review

Version

5.1

Component

salesforce_mapping.module

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024