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
- Install the
alert_messagemodule on a clean Drupal 11.3.12 site. - Navigate to Structure → Alert Message types → Manage fields.
- Click Add field, choose any field type (e.g. Text), fill in the label and machine name, and save.
- 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
Issue fork alert_message-3605693
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
enomo103 commentedComment #5
enomo103 commentedComment #7
aporieLGTM.
Thanks.
I will create a release soon, I have D12 compatibility things to release too.