Field layout module should fail gracefully whey layout plugin is missing

Created on 9 August 2017, almost 8 years ago
Updated 16 May 2025, 3 days ago

Problem/Motivation

Steps to reproduce:

  1. Do not start with the patch applied!
  2. Enable the Field Layout module
  3. Go to /admin/structure/types/manage/article/display and select the "Two Column" layout
  4. Apply the patch, clear the cache

This will cause a fatal error with the following exception:

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "layout_twocol" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 52 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

Proposed resolution

I propose we catch PluginNotFoundException and set default layout for the view mode (layout_onecol).

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Postponed

Version

11.0 🔥

Component

field_layout.module

Created by

🇷🇺Russia Chi

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024