From State/To State empty in v1.9 development version

Created on 8 April 2025, 8 days ago

I have a Drupal project on Drupal v10.4.6 with about 100 behat tests that are green/ok with drupal/workflow:1.8.0

I replace drupal/workflow by 1.x-dev using composer (without additional patches) and rerun the behats. Some behats fail.

I can manually replay one of the behat problems:
- I have a node bundle (person) that has a workflow defined on it.
- The node view was changed to include an EVA on the status history. It's a view using fields from the category "Workflow". The first two fields are "From State" and "To State".
- When I manually add a person using the "content" functionality, with drupal/workflow:1.8.0 I get as states "Created" and "Opened" in the first and only line of the view
- When I manually add a person using the "content" functionality, with drupal/workflow:1.x-dev I get empty fields. One line and time and user are filled in (but no states).

Additionally:
- When I create content with workflow 1.8 installed, I keep seeing those states after installing the dev version (and after flushing all caches)
- When I create content with the workflow development version installed, I don't see states after installing workflow 1.8.

So I think it's a creation issue, not a view issue.

🐛 Bug report
Status

Active

Version

1.0

Component

User interface

Created by

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

Comments & Activities

  • Issue created by @sboden
  • 🇳🇱Netherlands johnv

    Did you run update.php.
    Version 1.8 and 1.9 are about better usage of baseFieldDefinitions.
    This also includes from state and to state.
    If update.php does not work, you should remove and add the fields to the view.

  • drush updb did the trick. My bad, I'm reloading the database too much in ddev.

    This issue may be closed. What I did find while checking the base field definitions is that v1.8 has ->setSetting('target_type', 'workflow_state') on the from_sid/to_sid fields in the BaseFieldDefinitions. Version 1.x-dev doesn't have that, oversight or intentional?

  • 🇳🇱Netherlands johnv

    That seems like an oversight. Let me check.

  • 🇳🇱Netherlands johnv

    The link is a 'list_string', in order to get proper widgets for this.

    I might revert to entity_reference, but that will get 'autocomplete' widgets, too, in the workflow settings.

  • 🇳🇱Netherlands johnv

    If you use a Views display, the from_state and to_state fields must be deleted and added again, since the key is changed from 'target_id' to 'value'.
    (but let me test)

Production build 0.71.5 2024