Fixed
Project:
Workflow
Version:
2.1.10
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
15 May 2026 at 18:42 UTC
Updated:
15 May 2026 at 18:43 UTC
Jump to comment: Most recent
The function function _workflow_info_fields() return all Workflow Fields for the entity at hand.
For this, it runs $entity?->{$field_name};.
However, this invokes a createItem() on the FieldItemList.
- This is bad DX, since extra calls are made.
- Perhaps bad for performance
- It manipulates default code, unnecessarily.
Not sure if this was always the case (since D8) or introduced in a later Drupal version.
Replace the 'magic' function call $entity?->{$field_name};
by $entity->hasField($field_name).
It has the same result, without the side effects.
Comments