Entity Reference subfield - ECA unable to work with

Created on 14 August 2025, 10 days ago

Problem/Motivation

My plan is to use custom_field entity reference and replace the "standard" entity reference fields. However I found limitation - it does not work properly with ECA module β†’ .

Problem when you try to load entity from entity reference (or) just simply load entity reference field with ECA, it does not work and it says :
"Field 3 does not exist for entity type node/project..\n.. where number 3 is referenced entity in this example.

I am attaching recording for better understanding where I tested with a standard (ref) field and the same with custom_field sub-field (entity reference). Feel free to load this simple ECA model if needed (also attached).

It seems it handles different properties and ECA is expecting anything else.
Similar issue was resolved here Custom_field-3443547 πŸ’¬ suport for @custom_field Active so I believe this needs similar approach.

πŸ’¬ Support request
Status

Active

Version

3.1

Component

Code

Created by

πŸ‡ΈπŸ‡°Slovakia coaston

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

Comments & Activities

  • Issue created by @coaston
  • πŸ‡ΊπŸ‡ΈUnited States apmsooner

    You can see full list of available tokens in the help section: /admin/help/token

    In your case, it appears you need to replace :value with :entity

    Try that please and update the ticket.

  • πŸ‡ΈπŸ‡°Slovakia coaston

    Thank you for your input, but unfortunately ,the same result, except instead of ref.number "3" it uses "username" when I try with "entity".

    ECA Build form - Load via Reference (process_k086hog) for event eca.form.build: Field coaston does not exist for entity type node/project..\n\

  • πŸ‡ΊπŸ‡ΈUnited States apmsooner

    Looking at the LoadEntityRef action plugin here: https://git.drupalcode.org/project/eca/-/blob/3.0.x/modules/content/src/..., I don't really see how this is gonna work with any tokens. The code looks to make implications that its a regular entity reference field with defined structure that custom_field doesn't match up to. I would post this issue in the ECA slack channel with the link above and your issue as I believe this action plugin would need to be modified to support custom_field references. I'm gonna close this out as there's not really anything else I can do to support this.

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    I'm not surprised this doesn't work. The action plugin to load an entity from an entity reference field is for reference fields in an entity, not for entity fields inside something else, e.g. a custom field.

    So, that action plugin is not helpful here. But if the custom field module provides tokens for this, there is no need to use that action plugin in the first place. You do have that token available already and can use that directly.

  • πŸ‡ΈπŸ‡°Slovakia coaston

    Thank you guys, it works as expected. So the solution is very simple here.

    For others with a similar problem: There is no need to use Action(task) called "entity:load via reference", but for custom_field use just direct token instead.

    My profile fields:

    so I was able to use direct token in ECA :
    CustomFIeld: Required role is <strong>[buildstart:field_custom_pm:pm:entity:field_type_of_user]</strong>and assigned user will be: [buildstart:field_custom_pm:pm:entity:field_user_information]

    and this is expected result:

    Such a simple solution and I have spent like 3 days :D

Production build 0.71.5 2024