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.

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

spurlos created an issue. See original summary.

spurlos’s picture

StatusFileSize
new994 bytes

jan kellermann made their first commit to this issue’s fork.

jan kellermann’s picture

Status: Needs review » Reviewed & tested by the community

Could reproduce WSOD and the patch fixed the problem.

I created a MR (with a shortened category description).

jan kellermann’s picture

I also adjusted the Drupal versions to ^10.2 || ^11.

sayco’s picture

Status: Reviewed & tested by the community » Fixed

Merged, it will be part of the next minor release.

Status: Fixed » Closed (fixed)

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