PluginNotFoundException: The "" plugin does not exist when adding a variant with an empty label

Created on 4 September 2023, 10 months ago
Updated 21 March 2024, 3 months ago

Problem/Motivation

When I try to add a new variant with and empty label the following error is shown:

The website encountered an unexpected error. Please try again later.

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" plugin does not exist. Valid plugin IDs for Drupal\Core\Display\VariantManager are: block_page, block_display, layout_builder, http_status_code, simple_page in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

Steps to reproduce

  1. On a clean Drupal 10 installation, enable the page manager module and the page manager ui module.
  2. On the admin/structure/page_manager click on Add Page
  3. Fill the required fields on the form and finish the page creation
  4. After creating a new page, click on Add variant as the following picture shows
  5. On the form don't fill any fields just click on Next
  6. Now the error is displayed:

Proposed resolution

The solution would be to make the label field required, since a plugin can not be created without an empty string.

Remaining tasks

  1. Review
  2. Commit

User interface changes

The label field on the add variant form will be required

πŸ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡§πŸ‡·Brazil murilohp

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

Comments & Activities

Production build 0.69.0 2024