Cannot resave old nodes after adding workflow field

Created on 8 May 2025, about 1 month ago

drush entity:save node --bundle=xyz runs into an error on bundles where a workflow has been added later on so nodes exist where workflow has never been properly saved.

Error: Call to a member function getTransition() on null in Drupal\workflow\Entity\WorkflowManager::executeTransitionsOfEntity() (line 159 of /var/www/html/docroot/modules/contrib/workflow/src/Entity/WorkflowManager.php) #0 /var/www/html/docroot/modules/contrib/workflow/workflow.entity.inc(115): Drupal\workflow\Entity\WorkflowManager::executeTransitionsOfEntity()

Don't know though if it's an issue due to the config/setup of my project.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany Rudi Teschner

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

Comments & Activities

  • Issue created by @Rudi Teschner
  • 🇩🇪Germany Rudi Teschner

    Ok the work in the dev branch adresses the files named in this issue too. I will need to check whether this still happens when we update the module next time.

  • 🇳🇱Netherlands johnv

    This might still be an issue in 1.8, and perhaps in 2.0,
    but it should be resolved in current dev version and upcoming v2.1.
    The latest code has massaged away the difference between 'new entity' or 'existing entity with new field'.

Production build 0.71.5 2024