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
- Install Drupal 10.2 or later (reproduced on Drupal 11) with assertions enabled, e.g. a default DDEV setup.
- Enable tckk_field.
- Go to Structure > Content types > any type > Manage fields > Add field.
- 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
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
Comment #3
orkutmuratyilmazI've just created an MR for this issue.
Comment #4
sarbazx commentedMR is merged, thanks!
Comment #6
sarbazx commentedComment #7
orkutmuratyilmaz@sarbazx, thanks for the fix:)