Drupal\Core\Entity\EntityStorageException : Unable to apply data selector 'to_sid.target_id' at 'to_sid.target_id'

Created on 23 June 2025, about 2 months ago

Since the last stable update version 2.1.1, when submit my node form containing actions button based on a workflow, I have the error Drupal\Core\Entity\EntityStorageException : Unable to apply data selector 'to_sid.target_id' at 'to_sid.target_id': Property target_id is unknown. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of /web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
The status value are not changing. Could you correct this please ? On version 2.0.0 this problem doesn't exist.
Thanks a lot

🐛 Bug report
Status

Active

Version

2.1

Component

Workflow Node API

Created by

🇫🇷France dcoppel

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

Comments & Activities

  • Issue created by @dcoppel
  • 🇳🇱Netherlands johnv

    I cannot reproduce.
    Where do you have the Workflow Transition form (on node view, edit, block, history)
    Did you run update.php?

  • 🇳🇱Netherlands johnv

    Dou you have custom code?

  • 🇫🇷France dcoppel

    Hi,
    I have the workflow transition in my edit node form with one action button by workflow state.
    I ran the update.php after update workflow module.
    I do not have custom code. I use some rules (with Rules module) based on transition change status to send some emails.
    I hope this help. If you need more informations please ask !
    Regards

  • 🇳🇱Netherlands johnv

    OK, I will uninstall, donwgrade, then upgrade again,

  • 🇳🇱Netherlands johnv

    I could reproduce.
    Please test v2.1.2 or v2.0.x-dev, run update.php, and report back. Reopen if needed.

  • 🇫🇷France dcoppel

    Hi, thanks for helping resolve this bug !
    Nevertheless, after install version 2.1.2, I still have exactly the same issue.

  • 🇳🇱Netherlands johnv

    Some debugging is needed.

    IMO this happens because of the change(s) between WorkflowTransition::baseField['to_sid'] and ['from_sid'] being a list_string or an entity_reference.

    I guess this still happens when you switch from 'action buttons' to 'select list'?

    Can you determine what is being saved?
    - the node/entity, or
    - the WorkflowTransition

    In WorkflowTransition::save(), or its more generic parent EntityBase::save() in one of the first lines, you should find the 'target_id'. Unset that, and see what happens.

  • 🇫🇷France dcoppel

    Hi,
    Sorry for delay but I was not available this last ten days !
    The issue still exist un the last 2.1.4 version.
    This error is happening when changing the state of the state field even in a select list.

    I don't know how to know if its comming from WorkflowTransition::save(), or its more generic parent EntityBase::save()...
    Thanks for your help.

  • 🇳🇱Netherlands johnv

    There must be an update not executed.

    what does the following report say: /drupal/admin/reports/status#error

    please apply the patch and see what happens.

  • 🇳🇱Netherlands johnv

    Are you using an Action, by any chance?

  • 🇫🇷France dcoppel

    It's strange... I tried to reproduce the issue with 2.1.4 version today and there is no problem.
    I keep you inform if I arrive to reproduce this issue.

  • 🇫🇷France dcoppel

    In fact, my webcache site was the trouble !!! After restart apache service, the problem appear again.
    I put the patch that you gave and the same error appears.
    I hope this help !
    Thanks for your help.

  • 🇫🇷France dcoppel

    I just tried version 2.1.5 and there is still the same issue. I put version 2.0.0 that is ok for me...

  • 🇳🇱Netherlands johnv

    Hmm, we do not get any further.
    You save the entity, then set the field name and create a transition.
    It seems the field is not defined yet in the entity. Can you find out in which lin of code the error occurs?
    I could/should add exceptions?

Production build 0.71.5 2024