Introduce WorkflowItem::$list_class = "...\FieldType\WorkflowItemList"

Created on 5 September 2025, 27 days ago

Problem/Motivation

According to Lullabot's https://www.lullabot.com/articles/extending-a-field-type-in-drupal-8:

That List class can be anything that implements the FieldItemListInterface. This is the class that will store the list of values for any given instance of your field type.

In the methods we override in our widget and formatter classes, you’ll see $items is passed in as a parameter. That will be an instance of whatever you put as your list_class. Customizing that class is another way to tailor your field type specific to your needs.

Steps to reproduce

Proposed resolution

Introducing the list_class will remove the need to do $items->first(), which is now used to get code from the WorkflowItem.
From now on, we will access the WorkflowItemList, not the Item itself.

In this same issue, we will introduce better interface definitions for affected Workflow*Interface.php files.

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
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

Production build 0.71.5 2024