Problem/Motivation
When Drupal is installed inside a subdirectory, the "More information" button does not link correctly when an internal path is configured for it.
For example: if Drupal is installed at "http://www.example.com/subsite/" and the button url is configured to go to "/privacy-statement", clicking the "More information" button will lead you to "http://www.example.com/privacy-statement" instead of "http://www.example.com/subsite/privacy-statement".
Proposed resolution
Use Drupal's url functions (in Drupal\Core\Url) to construct the url.
Patch will follow.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | compliance-more-information-generate-url-2963917-3.patch | 2.61 KB | apolitsin |
| #2 | gdpr_compliance-more-information-generate-url-2963917-2.patch | 1.15 KB | megachriz |
Comments
Comment #2
megachrizApparently,
Url::fromUserInput()needs to be used for internal paths andUrl::fromUri()for absolute urls. To find out if the url is internal or absolute, I use similar logic as in assets/js/popup.js.Comment #3
apolitsin commentedMegaChriz, thanks.
The same logic needs to add to FormWarning.
Comment #5
apolitsin commented