Active
Project:
Group
Version:
3.3.5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 May 2026 at 17:07 UTC
Updated:
18 May 2026 at 17:07 UTC
Jump to comment: Most recent
GroupRelationshipTypeStorage::__construct() type-hints the $state parameter as Drupal\Core\State\State (concrete class) instead of Drupal\Core\State\StateInterface.
This breaks compatibility with any module that decorates the state service, which is a standard Drupal practice.
1. Create a module that decorates the state service:
# mymodule.services.yml
services:
mymodule.state_decorator:
class: Drupal\mymodule\StateDecorator
decorates: state
arguments:
- '@mymodule.state_decorator.inner'
// src/StateDecorator.php
class StateDecorator implements StateInterface {
// ... decorator implementation
}
2. Enable the group module (or any module depending on it)
3. Error occurs: TypeError: Drupal\group\Entity\Storage\GroupRelationshipTypeStorage::__construct(): Argument #7 ($state) must be of type Drupal\Core\State\State, Drupal\mymodule\StateDecorator given
Comments