Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing Assertion Error in FieldTypePluginManager due to missing field type categories configuration file #3992

Closed
caosborne89 opened this issue Jan 21, 2025 · 0 comments · Fixed by #4009
Assignees
Labels
bug Something isn't working developer experience

Comments

@caosborne89
Copy link
Contributor

caosborne89 commented Jan 21, 2025

Problem/Motivation

There's a failing Assertion in Drupals FieldTypePluginManager class. Depending on how your debugging is configured this could lead to a fatal error "AssertionError: "AZ Quickstart" must be defined in MODULE_NAME.field_type_categories.yml in assert() (line 195 of core/lib/Drupal/Core/Field/FieldTypePluginManager.php).".

To Reproduce

Steps to reproduce the behavior:

  1. Set assert_options(ASSERT_ACTIVE, TRUE); in Drupal settings or set the PHP config assert.active to on.
  2. Try adding a new field to any of the content types.
  3. You should receive the error " "AZ Quickstart" must be defined in MODULE_NAME.field_type_categories.yml in assert() " with a stack trace.

Proposed resolution

Looks like we need a az_quickstart.field_type_categories.yml file to define the category specified in FieldType definitions in AZ Quickstart. Currently the definitions for AZCardItem and AZAccordionItem set the category to category: new TranslatableMarkup("AZ Quickstart"), but "field type category as a translatable label in annotation is deprecated" (reference).

Expected behavior

Adding a new field to Content Types should not result in an Assertion Error.

@caosborne89 caosborne89 self-assigned this Jan 21, 2025
@caosborne89 caosborne89 added the bug Something isn't working label Jan 21, 2025
caosborne89 added a commit that referenced this issue Jan 21, 2025
Fixes #3992 by adding a az_quickstart.field_type_categories.yml file that defines the az_quickstart field type category. Update references to previous "AZ Quickstart" category.
@joeparsons joeparsons moved this from Todo to Needs review in 2.12.x Patch Release Issues Jan 23, 2025
caosborne89 added a commit that referenced this issue Jan 28, 2025
Remove FieldType category from Accordian and Card FieldTypes. Closes #3992.
@github-project-automation github-project-automation bot moved this from Needs review to Done in 2.12.x Patch Release Issues Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working developer experience
Projects
2 participants