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
- Install standard profile
- Enable Domain source for Article
- 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
- Write a merge request
- Review
- 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
Issue fork domain-3529385
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
idebr commentedThe merge requests updates the Domain Source OutboundPathProcessor to not rewrite the outbound URL if the source domain is the active domain
Comment #5
mably commentedComment #6
mably commentedHi @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.
Comment #7
mably commentedFor 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?
Comment #8
mably commentedAfter generating some logs on Gitlab CI, I can see that the failing node doesn't seem to have the right domain source defined:
Here is what I get when run locally:
What is rather strange is that we are testing the source just before doing the
toString():Comment #9
mably commentedFound 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.
For sure they didn't need to take the active domain into account then.
We do now, and on Gitlab CI, the test domain chosen was simply the already active domain.
So it couldn't work.
Test has been updated to be sure to avoid selecting the currently active domain.
Comment #10
mably commented@idebr everything is green again.
Do you want to have a look before I merge?
Comment #11
mably commentedComment #12
idebr commentedChanges look good. However, there is still an open thread in the merge request that is possibly outdated?
Comment #14
mably commentedIt's merged. Thanks!