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

Created on 8 November 2023, 7 months ago
Updated 2 February 2024, 5 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 19 minutes ago

Created by

πŸ‡ΊπŸ‡¦Ukraine super_romeo Kiev

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

Comments & Activities

Production build 0.69.0 2024