Plugin "Entity: set field value" not working if using token for new field value

Created on 8 January 2023, almost 2 years ago
Updated 29 January 2023, almost 2 years ago

Problem/Motivation

The attached model demonstrates how a set entity field value action fails when prior to that action the original node was access via token system.

Steps to reproduce

In the attached model, there are 2 relevant actions: Token: set value (without a label) and Entity: set field value (with label "Reset to old value"). The latter sets a field value to [orgvalue] which is filled in the former action. This behaves differently when:

  • If orgvalue is set to [unchanged-node:field_no_of_available_plots:value], then the field value is not correctly saved. During debugging I can see that the correct value is being assigned at \Drupal\eca_content\Plugin\Action\FieldUpdateActionBase::execute (line 426) but the entity is not being saved, although its save function is being called.
  • If orgvalue is set to an arbitrary value, e.g. 45, then everything works as expected.

The final message action is also showing the expected value, which is not saved to the entity if the token [unchanged-node:field_no_of_available_plots:value] is being used before setting the field value. As if something in the token system gets confused.

Proposed resolution

I wasn'T able yet to figure out, what's going wrong, but it looks like a serious issue.

🐛 Bug report
Status

Fixed

Version

1.2

Component

Code

Created by

🇩🇪Germany jurgenhaas Gottmadingen

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024