Problem/Motivation

Starting from core 10.2 (#3375748), FieldTypePluginManager expects field type category to be exposed in

MODULE_NAME.field_type_categories.yml, otherwise

Steps to reproduce

  1. On Drupal 10.3+/11, enable workflow module
  2. Try to add a field to any entity type

Proposed resolution

Expose "workflow" category in a new workflow.field_type_categories.yml

Remaining tasks

Write a patch

Issue fork workflow-3507790

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

valthebald created an issue. See original summary.

valthebald’s picture

Status: Active » Needs review

  • johnv committed aa8d7485 on 8.x-1.x
    Issue #3507790 by valthebald: Add workflow.field_type_categories.yml
    
johnv’s picture

Version: 8.x-1.x-dev » 8.x-1.8
Status: Needs review » Fixed

Thanks. I was just starting to work on it today, when you created the issue. Committed with credits.

Status: Fixed » Closed (fixed)

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

snowmountain’s picture

This issue does not seem fixed yet. I installed Workflow 1.8 today - 2025-04-01 - and the problem still exists on Drupal 11.1.5.
Also I did not find the dev version listed under "View all releases." Did I just miss it or is it not listed?

mariaioann’s picture

@snowmountain Correct, fix is not included in version 8.x-1.8, but is in 8.x-1.x and 2.0.x (see branches and tags sections here: https://git.drupalcode.org/project/workflow/-/commit/aa8d74856d27984c3fc...).
Since I am also using Workflow version 8.x-1.8 now, I have included the fix as a patch in my composer patches section:
https://git.drupalcode.org/project/workflow/-/merge_requests/21.diff

johnv’s picture

(Very late comment)
I use the version as follows: It is the version in which the problem appears last. The following release is the release that contains the fix.
Please use 2.1.x

marco aurelio rocca’s picture

I have been haunted by this issue for a week, even now, using Drupal 10.5.3 + Workflow 2.1.7.
Specially dazzling was the fact that the damned file ("workflow.field_type_categories.yml") WAS THERE, so what the hell could be missing?!

SOLVED by making the file start with an UPPER CASE "W", instead of "workflow"! -_-''

That made THIS the final content of such a file:

Workflow:
label: 'Workflow'
description: 'Field to store Workflow state value for a certain Workflow type.'

johnv’s picture

Status: Closed (fixed) » Active

:-)

  • johnv committed 46a33175 on 2.1.x
    Issue #3507790 by marco aurelio rocca : Add workflow....
johnv’s picture

Version: 8.x-1.8 » 2.1.7
Status: Active » Fixed

good catch.
I think it is the other way around: the captil W should be removed in the 'category' of WorkflowItem.php
see the commit. Thanks.

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

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

Maintainers, please credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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

vvs’s picture

I installed a patch #13. On Drupal 10.5.3 Workflow 2.1.7 does not work the same way.

It works on the Prod environment, but on the local DDEV - an error on add field: AssertionError: "Workflow" must be defined in MODULE_NAME.field_type_categories.yml in assert() (line 195 of core/lib/Drupal/Core/Field/FieldTypePluginManager.php).

prod: php 8.3.24 (after update on 8.3.26 the error does not appear)
ddev: php 8.3.25

P.S.: I can't reactivate this issue.

upd: after update local ddev drupal on 10.5.4 all working.

johnv’s picture

The version 2.1.7 means that the error (still) occurs in 2.1.7, and in fixed in 2.1.7+dev, and later version 2.1.8
So, the patch is not included in 2.1.7, yet.
Can you upgrade to DEV version? or wait for 2.1.8