Do not rewrite outbound URL if the source domain is the active domain

Created on 10 June 2025, 2 months ago

Problem/Motivation

The Domain Source module provides an OutboundPathProcessor to rewrite the path to entities to its configured Domain Source. However, there is no need to rewrite URLs when the source is the active domain.

Steps to reproduce

  1. Install standard profile
  2. Enable Domain source for Article
  3. Notice all entity links for an article are absolute URLs

Proposed resolution

Do not rewrite outbound URL if the source domain is the active domain

Remaining tasks

  1. Write a merge request
  2. Review
  3. Commit

User interface changes

URLs for an entity with a Domain Source are relative when the Domain Source is the active domain

API changes

None

Data model changes

None

📌 Task
Status

Active

Version

2.0

Component

- Domain Source

Created by

🇳🇱Netherlands idebr

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

Merge Requests

Comments & Activities

  • Issue created by @idebr
  • Pipeline finished with Failed
    2 months ago
    Total: 209s
    #518708
  • Pipeline finished with Failed
    2 months ago
    Total: 230s
    #518723
  • Pipeline finished with Failed
    2 months ago
    Total: 217s
    #518740
  • Pipeline finished with Failed
    2 months ago
    Total: 215s
    #518747
  • Pipeline finished with Success
    2 months ago
    Total: 221s
    #518756
  • 🇳🇱Netherlands idebr

    The merge requests updates the Domain Source OutboundPathProcessor to not rewrite the outbound URL if the source domain is the active domain

  • Status changed to Needs review 6 days ago
  • First commit to issue fork.
  • 🇫🇷France mably
  • 🇫🇷France mably

    Hi @idebr,

    I'm stuck on a functional test that runs fine on current version (D11) but fails on previous major (D10) when executed via a Gitlab CI pipeline.

    Test works perfectly fine locally on D11 and on D10.

    No idea what the problem could be.

    Any help will be greatly appreciated.

  • 🇫🇷France mably

    For now, I just disabled those 2 assertions when running on D10 in Gitlab CI.

    Could you give it a try locally on D10 just to be sure we are not letting something go thru?

  • 🇫🇷France mably

    After generating some logs on Gitlab CI, I can see that the failing node doesn't seem to have the right domain source defined:

    ----------------------------------------
    Path: /node/1
    Active domain: example_com
    Langcode: en
    Url: route:entity.node.canonical;node=1
    Entity id: 1
    Source id: example_com
  • 🇫🇷France mably

    Found the problem after a few hours of debugging.

    The test relies on the order of the results of call to loadMultiple().

    For some reason, the order is different on Gitlab than locally and the test fails.

    Don't know for what reason it has been done like this.

  • 🇫🇷France mably

    @idebr everything is green again.

    Do you want to have a look before I merge?

  • 🇫🇷France mably
  • 🇳🇱Netherlands idebr

    Changes look good. However, there is still an open thread in the merge request that is possibly outdated?

  • 🇫🇷France mably

    It's merged. Thanks!

Production build 0.71.5 2024