While on an entity view route that is assigned to a domain source, link destinations are broken because they include the domain

Created on 6 November 2024, about 2 months ago

Drupal Version

Drupal 10.3.5

Domain module version

Domain 2.0.0-beta2

Expected Behavior

When on an entity view route, I expect any links generated to include a destination by RedirectDestinationTrait or \Drupal\Core\Routing\RedirectDestination to have a proper, working destination. That is, the destination being an absolute link to the current page but without the domain.

Actual Behavior

Destinations generated by RedirectDestination include the entity's domain, which breaks the functionality of the destination. When you visit the link, the destination parameter disappears, presumably because it is considered an external destination.

Steps to reproduce

I'm not sure the easiest way to reproduce. I encountered this issue with a custom block that uses RedirectDestinationTrait to create a login link with a destination of the current page.

Additional Information

I traced this issue to the very thing mentioned in #3197879: Domain module renders invalid URLs when using domain source β†’ where DomainSourcePathProcessor always sets the absolute option to true when viewing an entity assigned to a domain source.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States pianomansam

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

Comments & Activities

Production build 0.71.5 2024