Problem/Motivation
SiteimproveUrils::getEntityUrls() produces URLs on wrong language and contains twice the domain. Erroneous URL is http://example.comhttps//example.com/my-custom-page.
Steps to reproduce
Not sure about the root cause, but I assume the issue comes with https://www.drupal.org/project/domain module. The site I've faced this does not have submodule domain_access enabled.
Proposed resolution
Use translated entity and do not append the domain to url if its already present.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3491332-4.patch | 1.24 KB | nicross-com |
Comments
Comment #2
sokru commentedThe patch contains proof-of-concept of the fix, it should be rather safe change.
Comment #3
beltofteComment #4
nicross-com commentedThanks for working on this. We found one functional issue with the original patch which can lead to an
InvalidArgumentException(invalid translation language). This updated version of the patch adds ahasTranslation()check before callinggetTranslation(). Cheers!Comment #7
beltofteThanks for the issue report and the patches. The issue is originating from Domain Access. Not sure why Domain Access in some cases cause that $entity->toUrl() returns the absolute URL with domain and not the relative URL. I have implemented a fix that is a bit different, to handle cases where the Domain Access domain plugin returns multiple domains.
Comment #8
beltofte