WSOD on field type selection

Created on 31 December 2024, 20 days ago

Problem/Motivation

The paragraph_view_mode field type currently defines its category as a translatable string (@Translation) in the field type annotation. This method is now deprecated, and categories must be defined in a <module>.field_type_categories.yml file. Without this update, attempting to add the field type results in a WSOD (White Screen of Death) due to incompatibility with the latest Drupal standards.

Ref: https://www.drupal.org/node/3375748 β†’

Steps to reproduce

  1. Install the paragraph_view_mode module.
  2. Navigate to an entity type (e.g., Content type, Paragraph type) and click "Add field".
  3. Observe the WSOD when attempting to view the field type options.

Proposed resolution

  1. Create a paragraph_view_mode.field_type_categories.yml file in the module's base directory with the following content:
    manage_display:
      label: 'Manage display'
      description: 'Fields used to configure entity display settings.'
      weight: -20
      libraries:
        - options/drupal.options-icon
  2. Update the ParagraphViewModeItem field type definition in the src/Plugin/Field/FieldType/ParagraphViewModeItem.php file to reference the manage_display category by its static ID:
    *   category = "manage_display",

Remaining tasks

None.

User interface changes

  • A new "Manage display" group is shown in the Field UI.
  • The Paragraph view mode field type is now available for selection in the second step when adding a new field.

API changes

  • The category in the @FieldType annotation is now a static ID ("manage_display") rather than a translatable string.

Data model changes

None.

πŸ› Bug report
Status

Needs review

Version

3.1

Component

Code

Created by

πŸ‡²πŸ‡©Moldova Spurlos Chisinau

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024