When updaing the link module from version 1.3 to 1.4. I noticed url's like '/node/1' are not accepted anymore as valid url's. This is a regression versus version 1.3, where this did work. Links like 'node/1' however are accepted as valid urls.
I understand that there is discussion whether this is a valid url, especially thinking of drupal installation installed in a subdirectory.
Attached a patch which fixes this for us.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mallezie created an issue. See original summary.

mallezie’s picture

Status: Needs review » Needs work

The last submitted patch, 2: link-2850681-2-allow-leading-slash.patch, failed testing.

gaurav.kapoor’s picture

Fixed the bugs in patch , whitespaces , etc.

gaurav.kapoor’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: link-allow-leading-slash-2850681-4.patch, failed testing.

dalin’s picture

I disagree with where the fix was placed. I think this is a better spot.

Status: Needs review » Needs work

The last submitted patch, 7: 2850681-link-allow_leading_slash-7.patch, failed testing.

dalin’s picture

Status: Needs work » Needs review
FileSize
1.32 KB

Hmmm, nope, still a little off. This one works, and the URL is correctly typed as "internal".

Status: Needs review » Needs work

The last submitted patch, 9: 2850681-link-allow_leading_slash-8.patch, failed testing.

dalin’s picture

Status: Needs work » Needs review

AFAICT these failing tests have nothing to do with this patch. The first failure happens when a link field is added to a node bundle.

JosueRodrigu3z’s picture

We recently updated from 1.3 to 1.5 and notice that we can no longer add paths with leading slash "/node-path".

idebr’s picture

Status: Needs review » Needs work

The last submitted patch, 13: link-allow_leading_slash-2850681-13.patch, failed testing. View results

PieterDC’s picture

Thanks for the patch.