Error: Call to a member function getTransition() on null in WorkflowTransitionForm::getDefaultTransition() (line 93) on user data after logging in

Created on 25 June 2024, 10 months ago
Updated 9 July 2024, 9 months ago

Problem/Motivation

After logging in as a user with a Workflow field on the user fields, the following error appears:

Error: Call to a member function getTransition() on null in Drupal\workflow\Form\WorkflowTransitionForm::getDefaultTransition() (line 93 of modules\workflow\src\Form\WorkflowTransitionForm.php).

Steps to reproduce

- add a field to the user data
- add the field as a block to the user page
- log in as that user.
- since the user has not that field filled in the following line, the error is set.
$entity->{$field_name}[0]->getTransition()

Proposed resolution

Add extra test in above-mentioned line.

🐛 Bug report
Status

Fixed

Version

1.8

Component

Code

Created by

🇳🇱Netherlands johnv

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

Comments & Activities

Production build 0.71.5 2024