Token chains like [node:reference_field_name:entity:entity_token] support only content entities as restricted by the code in token.tokens.inc:
if (isset($field_item->$property_name) && ($field_item->$property_name instanceof FieldableEntityInterface)) {

This doesn't allow to use (in chains) tokens defined for config entities such as domains. I suggest to ease this restriction, so that any entity reference can be used in chains.

Comments

maximpodorov created an issue. See original summary.

maximpodorov’s picture

Status: Active » Needs review
StatusFileSize
new637 bytes
djdevin’s picture

Issue tags: +Needs tests

Tested working.

Example, we have an enrollment entity that has an entity reference to credit awarded, which has an entity reference to a config entity of a credit type.

Patch allows this token to work

Course enrollment (Content) -> Credit awarded (Content) -> Credit type (Config)

[course_enrollment:course_credit_awarded:0:entity:type:0:entity]

Probably needs some tests.

b-prod’s picture

StatusFileSize
new1.04 KB

Reroll for 1.17