Wrong alias for access_policy_processor service in core.services.yml

Created on 11 June 2025, 2 days ago

Problem/Motivation

The alias for the access_policy_processor service uses a non existant interface:

access_policy_processor:
  class: Drupal\Core\Session\AccessPolicyProcessor
  arguments: ['@variation_cache.access_policy', '@variation_cache.access_policy_memory', '@cache.access_policy_memory', '@current_user', '@account_switcher']
  tags:
    - { name: service_collector, call: addAccessPolicy, tag: access_policy }
Drupal\Core\Session\AccessPolicyChainInterface: '@access_policy_processor'

Drupal\Core\Session\AccessPolicyChainInterface should be Drupal\Core\Session\AccessPolicyProcessorInterface as Drupal\Core\Session\AccessPolicyChainInterface doesn't exist.

Steps to reproduce

Try to create a service that autowires Drupal\Core\Session\AccessPolicyProcessorInterface:

use Drupal\Core\Session\AccessPolicyProcessorInterface;

class MyClass {
  public function __construct(
    private readonly AccessPolicyProcessorInterface $accessPolicyProcessor,
  ) {}
}

This fails with:

Cannot autowire service "Drupal\Core\Session\AccessPolicyProcessorInterface": argument "$accessPolicyProcessor" of method "Drupal\my_module\Form\SubmitTaskForm::_construct()", you should configure its value explicitly.

Proposed resolution

Fix the alias: Drupal\Core\Session\AccessPolicyProcessorInterface: '@access_policy_processor'

Remaining tasks

Review the code.

User interface changes

None.

Introduced terminology

None.

API changes

None.

Data model changes

None.

Release notes snippet

This has never worked, so I think no release notes are required.

🐛 Bug report
Status

Active

Version

11.0 🔥

Component

base system

Created by

🇮🇹Italy lussoluca Italy

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024