Problem/Motivation

When adding a new field to the Alert Message entity via Structure → Alert Message → Manage fields → Add field, saving the field results in the following error:

Error message
Attempt to update field Alert Message failed: The "label" plugin does not exist. Valid plugin IDs for Drupal\Core\Field\FormatterPluginManager are: comment_default, comment_username, comment_permalink, datetime_plain, datetime_custom, datetime_default, datetime_time_ago, file_audio, file_url_plain, file_default, file_video, file_rss_enclosure, file_uri, file_link, file_extension, file_filemime, file_table, file_size, image_url, image, link, link_separate, list_key, list_default, entity_reference_rss_category, text_trimmed, text_summary_or_trimmed, text_default, author, user_name, string, email_mailto, number_decimal, language, uri_link, number_integer, number_unformatted, timestamp, timestamp_ago, boolean, basic_string, entity_reference_entity_view, entity_reference_entity_id, entity_reference_label.

Steps to reproduce

  1. Install the alert_message module on a clean Drupal 11.3.12 site.
  2. Navigate to Structure → Alert Message types → Manage fields.
  3. Click Add field, choose any field type (e.g. Text), fill in the label and machine name, and save.
  4. Observe the error on save.

Expected behavior

The field is created and the entity display is updated without errors.

Actual behavior

Drupal\Component\Plugin\Exception\PluginNotFoundException is thrown with the message above, and the field is not saved to the display.

Proposed fix

Audit all core.entity_view_display.alert_message.* config YAML files shipped with the module and replace any type: label formatter entries with the correct plugin ID, e.g. type: entity_reference_label or another appropriate formatter depending on the field type.

Environment

  • Drupal version: 11.3.12
  • PHP version: 8.3
  • alert_message module version:1.1.1
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

dkmishra created an issue. See original summary.

enomo103 made their first commit to this issue’s fork.

enomo103’s picture

Assigned: Unassigned » enomo103

enomo103’s picture

Assigned: enomo103 » Unassigned
Status: Active » Needs review

  • aporie committed 2345e2b7 on 1.1.x authored by enomo103
    fix: #3605693 Creating a field fails with "The 'label' plugin does not...
aporie’s picture

Status: Needs review » Fixed

LGTM.

Thanks.

I will create a release soon, I have D12 compatibility things to release too.

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.

Status: Fixed » Closed (fixed)

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