Generated with the help of an LLM.

Problem/Motivation

Running drush updb with Drupal 10.6.20, Group 3.3.5 and Groupblock 3.0.0 fails during container compilation:

Cannot autowire service "Drupal\groupblock\Hook\GroupblockHooks": argument "$groupRelationTypeManager" of method "__construct()" references interface "Drupal\group\Plugin\Group\Relation\GroupRelationTypeManagerInterface" but no such service exists.

Group provides the group_relation_type.manager service, but does not register an alias for this interface.

Steps to reproduce

  1. Use the versions above with Group and Groupblock enabled.
  2. Run drush updb.
  3. Observe the container compilation error.

Proposed resolution

Explicitly identify the service for the constructor argument in GroupblockHooks:

#[Autowire(service: 'group_relation_type.manager')]
protected GroupRelationTypeManagerInterface $groupRelationTypeManager,

The class already imports the Autowire attribute.

Remaining tasks

Implement and test the fix.

User interface changes

None.

API changes

None expected.

Data model changes

None.

Issue fork groupblock-3633970

Command icon Show commands

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

freelock created an issue. See original summary.

  • freelock committed 66cc422b on 3.x
    fix: #3633970 GroupblockHooks cannot autowire...
lobsterr’s picture

Status: Active » Fixed

Thanks for your contribution

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

mradcliffe’s picture

Thank you, @freelock, @lobsterr!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.