Problem/Motivation

TCKimlikNoItem declares its field type category as a translated label:

 *   category = @Translation("General"),

Since Drupal 10.2, field type categories are plugins defined in MODULE_NAME.field_type_categories.yml, and the category key of a field type must be the machine name of one of them. Core's category is general, so the label "General" matches nothing.

With PHP assertions enabled, FieldTypePluginManager::getGroupedDefinitions() fails and the "Add field" page cannot be opened on any entity bundle:

AssertionError: "General" must be defined in MODULE_NAME.field_type_categories.yml in assert() (line 183 of core/lib/Drupal/Core/Field/FieldTypePluginManager.php).

With assertions disabled, core silently falls back to general, so the bug is only visible on development environments.

Steps to reproduce

  1. Install Drupal 10.2 or later (reproduced on Drupal 11) with assertions enabled, e.g. a default DDEV setup.
  2. Enable tckk_field.
  3. Go to Structure > Content types > any type > Manage fields > Add field.
  4. The request returns HTTP 500 with the AssertionError above.

Proposed resolution

Use the machine name in the annotation of TCKimlikNoItem:

 *   category = "general",

Alternatively, remove the line, since general is the default.

Remaining tasks

Create a merge request, review, commit.

Issue fork tckk_field-3623961

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

orkutmuratyilmaz created an issue. See original summary.

orkutmuratyilmaz’s picture

Status: Active » Needs review

I've just created an MR for this issue.

sarbazx’s picture

Assigned: Unassigned » sarbazx
Status: Needs review » Fixed

MR is merged, thanks!

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.

sarbazx’s picture

Status: Fixed » Closed (fixed)
orkutmuratyilmaz’s picture

@sarbazx, thanks for the fix:)