Add support for File (AJAX) item on WorkflowTransition /3

Created on 28 October 2025, 7 days ago

Problem/Motivation

In the (attached) predecessors of this issue , problems were addressed when a WorkflowTransition has an attached field like FileItem.
Actually, the problem seems to be with any widget that contains AJAX buttons, like 'Upload file', 'Add another', or 'Remove'.

In Workflow v2.1.8, the widget is rationalized to use 'official' Widget interface. On a Node form, the WorkflowTransition widget is now created by calling the 'WorkflowTransition' form (like happens on History tab or Workflow Block) and then wrapping it in a widget. This is possible since all attributes are added as WorkflowTransition::baseFieldDefinitions().

This works fine and removes a lot of duplicate code.

However, in some use cases, the ajax widget for attached fields are broken.

Steps to reproduce

- Create a workflow,
- add a File field to the Workflow
- Create a Node Type with Workflow State field of above Workflow
- Add a multivalue field e.g., Number or Text.
- (Other widget may give the same or other result, like IEF complex widget)
- Create/Edit a node of above Note Type
(Note: in the past, a problem only existed on 'Create' case. now, there is no difference)
- Test 1: Add a file item to the WorkflowTransition - this works fine - the file is attached.
- Test 2: Press Ajax 'Remove' or 'Add' button of multivalue field, then add a file item - The file is not attached.

Proposed resolution

Best guess is that the $form['#parents'] is set incorrectly in the WorkflowDefaultWidget::formElement().
It is also set in WorkflowTransitionForm::form().

Remaining tasks

- Test simpler widget on WorkflowTranstion - The file widget is a complex widget - add test with Number multivalue field on WorkflowTransition
- Test normal situation - test with 2 ajax fields on node itself
-

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.1

Component

Code

Created by

🇳🇱Netherlands johnv

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024