Problem/Motivation

When trying to add a new field on Drupal 11.3 I see the following error

AssertionError: "Slug" must be defined in MODULE_NAME.field_type_categories.yml in assert() (line 183 of /Users/andy/Sites/bhcclocalgov/docroot/core/lib/Drupal/Core/Field/FieldTypePluginManager.php).

Additionally, I see this error once adding the correct file.

TypeError: Cannot access offset of type Drupal\Core\StringTranslation\TranslatableMarkup in isset or empty in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 45 of /Users/andy/Sites/bhcclocalgov/docroot/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

Steps to reproduce

  1. Make sure PHP assertions are on.
  2. Install entity_slug
  3. Go to a content type
  4. try to add a new field
  5. See error
  6. Proposed resolution

    Add the entity_slug.field_type_categories.yml file and change the field categories to not use translation.

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

andybroomfield created an issue. See original summary.

andybroomfield’s picture

Status: Active » Needs review