Drupal 8 compatibility: GetResponseEvent instance for the DomainSubscriber::onKernelRequestDomain() argument

Created on 16 February 2023, almost 2 years ago
Updated 29 March 2024, 8 months ago

Drupal and module version

Drupal 8.9.20 + Domain 8.x-1.x-dev

Actual behavior

Drupal 8 Symfony component expects GetResponseEvent, but we have RequestEvent argument in the DomainSubscriber::onKernelRequestDomain() event subscriber method.
TypeError: Argument 1 passed to Drupal\domain\EventSubscriber\DomainSubscriber::onKernelRequestDomain() must be an instance of Symfony\Component\HttpKernel\Event\RequestEvent, instance of Symfony\Component\HttpKernel\Event\GetResponseEvent given in Drupal\domain\EventSubscriber\DomainSubscriber->onKernelRequestDomain() (line 90 of modules/contrib/domain/domain/src/EventSubscriber/DomainSubscriber.php).
RequestEvent argument is need for Drupal 9, but for Drupal 8 we should use GetResponseEvent argument.

Proposed solution

The best way is to split this module into 2 versions: for Drupal 8 - could be the current version
And create a new one or use 2.0 for Drupal 9 || 10.

As for now I'll add a patch to apply for Drupal 8 compatibility.

πŸ› Bug report
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine vselivanov Kyiv, Ukraine

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

Comments & Activities

Production build 0.71.5 2024