_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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kurapov’s picture

kurapov’s picture

Issue summary: View changes
kurapov’s picture

FileSize
652 bytes

Shawks, 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.

sumitmadan’s picture

Status: Active » Needs review

Moving to Needs Review status.

Status: Needs review » Needs work

The last submitted patch, 3: link-leading-hash-fix-2318643-3-D7.patch, failed testing.

fox_01’s picture

FileSize
716 bytes

Here is a patch for the newer version 7.x-1.3 which works for me

sumitmadan’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 6: link-2318643-7.x-1.3.patch, failed testing.

bocaj’s picture

Status: Needs work » Needs review
FileSize
705 bytes

Here is the patch for 7.x-1.4 and latest dev.

Status: Needs review » Needs work

The last submitted patch, 9: 2318643-Leading_hash_fix-7.x-1.4.patch, failed testing.

bocaj’s picture

Forgot to remove a closing parenthesis. This patch resolves that.

bocaj’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 11: 2318643-Leading_hash_fix-7.x-1.4-11.patch, failed testing.

haleagar’s picture

I 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.

Daniel Korte’s picture

Status: Needs work » Closed (works as designed)

This 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