The replacement of service "redirect_response_subscriber" does not work

Created on 3 April 2025, 2 days ago

Drupal Version

10.4.*

Domain module version

2.0.0-beta2

Expected Behavior

The README file of Domain source states:

Domain Source changes core's `redirect_response_subscriber` service to the `DomainSourceRedirectResponseSubscriber` class. This allows us to issue redirects to registered domains and aliases that would otherwise not be recognizes as internal Drupal links. These redirects typically occur on entity save when the source domain varies from the current domain.

Actual Behavior

The service replacement is not made at all. Moreover, the event subscriber is clearly not up to date with the redirect_response_subscriber service. It should not copy the code from this service, as it will probably continue to evolve, but try to do as least as possible and rely on the parent method.

When requesting an URL for a page which source is defined to another domain, the user is not redirected to the correct domain

Steps to reproduce

Install Domain and Domain source

  • Create 2 domains, "A" and "B"
  • Make the login form
  • Make the "page" content type using the domain source field
  • Create a route related to domain "A" with role restrictions for example
  • Create a subscriber which extends "HttpExceptionSubscriberBase" and override the on403 method to redirect to user login
  • Make the login page allowed only for the "B" domain

The expected behavior is to have the user redirected from the A domain to the user login page on the "B" domain.

Instead we have an error page because the "redirect_response_subscriber" does not find a secured response.

🐛 Bug report
Status

Active

Version

2.0

Component

- Domain Source

Created by

🇱🇺Luxembourg B-Prod

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

Comments & Activities

Production build 0.71.5 2024