The node context is not a valid context.

Created on 7 December 2021, over 3 years ago
Updated 21 January 2023, about 2 years ago

Problem/Motivation

Hi Team

After I upgrade my site to Drupal 9, I getting the following error while trying to view à edit form block in a node page.

Steps to reproduce

- Go to /admin/structure/block add a block Content edit form : choose node type and make it visible for the choosen content type
- Go to the node page

Proposed resolution

In NodeEditFormBlock.php replace context with context_definitions
/**
* Provides a block for node forms.
*
* @Block(
* id = "formblock_node_edit",
* admin_label = @Translation("Content edit form"),
* provider = "node",
* category = @Translation("Forms"),
* context_definitions = {
* "node" = @ContextDefinition("entity:node")
* }
* )
*
* Note that we set module to node so that blocks will be disabled correctly
* when the module is disabled.
*/

🐛 Bug report
Status

Closed: outdated

Version

2.0

Component

Code

Created by

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