Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
_link_sanitize function doesn't handle the cases when link address has no "url", only the "fragment" and/or "query" part, thus such address gets passed as external/unrecognized and corresponding options for l() are not created during output.
Comment | File | Size | Author |
---|---|---|---|
#11 | 2318643-Leading_hash_fix-7.x-1.4-11.patch | 731 bytes | bocaj |
#9 | 2318643-Leading_hash_fix-7.x-1.4.patch | 705 bytes | bocaj |
#6 | link-2318643-7.x-1.3.patch | 716 bytes | fox_01 |
#3 | link-leading-hash-fix-2318643-3-D7.patch | 652 bytes | kurapov |
Comments
Comment #1
kurapov CreditAttribution: kurapov commentedComment #2
kurapov CreditAttribution: kurapov commentedComment #3
kurapov CreditAttribution: kurapov commentedShawks, just noticed it doesn't prepend the current URL to the link, thus creating a link to the front page... This quick and dirty fix (as per https://api.drupal.org/comment/24083#comment-24083) to illustrate the issue.
Comment #4
sumitmadan CreditAttribution: sumitmadan commentedMoving to Needs Review status.
Comment #6
fox_01 CreditAttribution: fox_01 commentedHere is a patch for the newer version 7.x-1.3 which works for me
Comment #7
sumitmadan CreditAttribution: sumitmadan commentedComment #9
bocaj CreditAttribution: bocaj commentedHere is the patch for 7.x-1.4 and latest dev.
Comment #11
bocaj CreditAttribution: bocaj commentedForgot to remove a closing parenthesis. This patch resolves that.
Comment #12
bocaj CreditAttribution: bocaj commentedComment #14
haleagar CreditAttribution: haleagar commentedI also experience this issue, and it is l() called in theme_link_formatter_link_default where the problem occurs,
however the patch here seems to have no impact on the output.
Comment #15
Daniel KorteThis is a problem with the Drupal core
url()
function. I made a patch for it here: #3041216: Allow both external and internal URLs to benefit from fragment splitting in the url() function