Required contexts without a value: entity in ContextHandler->applyContextMapping()

Created on 8 November 2023, about 1 year ago
Updated 2 February 2024, 11 months ago

Drupal\Component\Plugin\Exception\MissingValueContextException: Required contexts without a value: entity in Drupal\Core\Plugin\Context\ContextHandler->applyContextMapping() (line 150 in /.../core/lib/Drupal/Core/Plugin/Context/ContextHandler.php)

Path: /product/130/layout

For some reason, the layout block is saved corrupted (does not have a context_mapping 'entity').

Must be:

id: 'field_block:commerce_product:default:variations'
label: 'How would you like to proceed?'
label_display: visible
provider: layout_builder
context_mapping:
  entity: layout_builder.entity (!!!)
  view_mode: view_mode

Actual:

id: 'field_block:commerce_product:default:variations'
label: 'How would you like to proceed?'
label_display: visible
provider: layout_builder
context_mapping:
  view_mode: view_mode

Workround
Adding a context_mapping entity to the layout block on the fly to be able to save it in the UI.

Patch will be attached.
It's JUST workaround.

πŸ› Bug report
Status

Closed: duplicate

Version

9.5

Component
Layout builderΒ  β†’

Last updated 4 days ago

Created by

πŸ‡·πŸ‡ΈSerbia super_romeo Belgrade

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

Comments & Activities

Production build 0.71.5 2024