Problem/Motivation

If I try to create a new node which has a workflow field, the select or radio button list of states is empty.

Steps to reproduce

Configure a workflow field to use either the "Select list" or "Check boxes/radio buttons" form display widget. Create a new node using the type. On the form, there are no workflow states listed and the form does not pass validation. This only happens in the -dev branch, not 2.2.2/2.1.10.

Proposed resolution

The 2.1.x-dev branch removed this code from WorkflowItem::getTransition. It should be replaced so that a default transition is created when the node is unsaved:

    $transition ??= WorkflowTransition::create([
      'entity' => $this->getEntity(),
      'field_name' => $this->getParent()->getName(),
      'wid' => $this->getWorkflowId(),
    ]);

Comments

gribnif created an issue. See original summary.

johnv’s picture

Status: Active » Postponed (maintainer needs more info)

Hmm, I cannot reproduce that on a new installation.

In the workflow Transitions configuration, are the role settings OK?
Especially that for author?
In the Permissions page, if you disable the 'Authenticated user', you may find hidden permissions for the other user types.

  • johnv committed 24cf2524 on 2.1.x
    Issue #3595609: Revert Item::getTransition from #3590383:
    
johnv’s picture

Version: 2.1.x-dev » 2.1.10
Status: Postponed (maintainer needs more info) » Fixed
Parent issue: » #3590383: Avoid ::createItem when inspecting fields

It should not be possible, but OK, I reverted the code change from #3590383: Avoid ::createItem when inspecting fields

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.