Needs review
Project:
Context
Version:
5.0.0-rc2
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
14 Sep 2026 at 14:18 UTC
Updated:
23 Sep 2026 at 12:42 UTC
Jump to comment: Most recent
On Drupal 11.2+, the Context module triggers the following deprecation:
Not supporting attribute discovery in Drupal\context\ContextReactionManager is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Provide an Attribute class and an Annotation class for BC. See https://www.drupal.org/node/3395582
Drupal\context\ContextReactionManager.ContextReaction annotation properties.ContextReactionManager to pass the attribute class first and the existing annotation class second to DefaultPluginManager::__construct(). Retain the annotation class for backwards compatibility.
Conceptually, the plugin manager constructor call should become:
parent::__construct(
'Plugin/ContextReaction',
$namespaces,
$module_handler,
ContextReactionInterface::class,
\Drupal\context\Attribute\ContextReaction::class,
\Drupal\context\Annotation\ContextReaction::class,
);
ContextReaction attribute class.ContextReactionManager to support attribute discovery with annotation fallback.None.
A new Drupal\context\Attribute\ContextReaction attribute class will be introduced. The existing annotation class should remain available for backwards compatibility.
None.
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
eelkeblokComment #3
eelkeblokComment #4
eelkeblokComment #6
eelkeblokShould look something like this. Disclaimer: I've used AI to do the initial draft of the change.
I dropped support in all info.yml files for everything below 10.2, as attributes work since then (Codex was including conditional code checking for the existence of the Attribute class, which seems overkill). Note that the currently only supported minor version of Drupal 10 is 10.6.
Since 5.0 has been in RC for so long, this introduces a bit of a dilemma, because it would introduce a gap in the supported core versions. However, there are no suppored versions of Context 4 listed on the project page, and 5.0 is still in RC, I think we are good. Maybe the chance should even be taken to raise the minimimal core version to ^10.6.
Note that even if 4.x was still supported, "general wisdom" suggests dropping support for unsupported core versions does not require a new major version (https://www.drupal.org/docs/develop/managing-a-drupalorg-theme-module-or...).