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.

Comments

MegaChriz created an issue. See original summary.

megachriz’s picture

Assigned: megachriz » Unassigned
Status: Active » Needs review
StatusFileSize
new1.15 KB

Apparently, Url::fromUserInput() needs to be used for internal paths and Url::fromUri() for absolute urls. To find out if the url is internal or absolute, I use similar logic as in assets/js/popup.js.

apolitsin’s picture

Assigned: Unassigned » apolitsin
StatusFileSize
new2.61 KB

MegaChriz, thanks.

The same logic needs to add to FormWarning.

  • APolitsin committed 3cf08c0 on 8.x-1.x authored by MegaChriz
    Issue #2963917 by MegaChriz, APolitsin: "More information" button does...
apolitsin’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.