Fatal error on Manage Display form cause by NavigationPlusUi::deriveEntityFromRoute() if layout builder is not enabled

Created on 24 February 2025, about 1 month ago

Problem/Motivation

I was attempting to try out edit_plus to maybe contribute to it but have been hitting blockers (will raise something there to ask) but started to realise it seems geared for layout builder only, so I attempted to go to manage display to enable layout builder on a node bundle but hit this:

Drupal\Component\Plugin\Exception\ContextException: The entity context is not a valid context. in Drupal\layout_builder\Plugin\SectionStorage\SectionStorageBase->getContextDefinition() (line 150 of core/lib/Drupal/Core/Plugin/ContextAwarePluginTrait.php).
Drupal\layout_builder\Plugin\SectionStorage\SectionStorageBase->getContext() (Line: 82)
Drupal\layout_builder\Plugin\SectionStorage\SectionStorageBase->getContextValue() (Line: 203)
Drupal\navigation_plus\NavigationPlusUi->deriveEntityFromRoute() (Line: 67)

Steps to reproduce

Set up a content type and enable edit plus without yet having layout builder in place
Attempt to go enable layout builder

Proposed resolution

Only try to get context value from a parameter that is an entity interface

Remaining tasks

MR

User interface changes

No fatal error

API changes

N/A

Data model changes

N/A

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom scott_euser

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