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.
I have looked around the issue queue to see what I might be doing wrong, but I couldn't find anything relevant, so I would like to report the following possible fault:
The Link module allows me to define a field for a URL. It accepts (eg) "drupal.org" as a value and displays it as "http://drupal.org" with the correct hyperlink. But Link checker sticks my domain name on the front to get "http://mydomain.co.uk/drupal.org" and, unsurprisingly, reports this as a broken link. For consistency with Link, I think Link checker should supply the missing "http://" prefix when checking for a broken link.
Comment | File | Size | Author |
---|---|---|---|
#6 | 1535594-6.patch | 1.12 KB | a.mikheychik |
Comments
Comment #1
hass CreditAttribution: hass commentedHm... well... maybe... the better would be if you add the http:// correctly to the link.
I have no idea how I should detect relative paths. Someone can enter "mycustom/path/to/asubdir" and in this case it's base path is the node path. This is how link field works as I know, too. I'm not sure how it is able to detect you incomplete hostname... link modul is really doing some strange things and I cannot reuse any function from this module yet. I tried it, but failed.
We need API function from link module I can just call and get the link back how it should be rendered per link module rules. Otherwise I need to guess and this is the bet guess.
Comment #2
timjh CreditAttribution: timjh commentedThanks for your response, and I'm sorry about the duplication - I couldn't find my original post and got no notifications even though I was following it, so I assumed it had gone down a black hole.
I would have thought that the presence of dots and high level domain codes would be very suggestive of a url that is intended to be absolute, and at least worth a try with an http:// prefix before perhaps going on to try a relative path. But, having said that, your approach of using a Link field API sounds like a better engineered solution. Meanwhile I suppose I will have to go through several hundred links and insert the http:// prefix :-(.
Comment #3
hass CreditAttribution: hass commentedNot really... you can have paths with dots... very common.
Comment #5
hass CreditAttribution: hass commentedMarked #1697446: External link with no schema prefix (e. g. http://) recognized incorrectly as internal as duplicate.
Comment #6
a.mikheychik CreditAttribution: a.mikheychik commentedHere is my patch for this.
Comment #7
hass CreditAttribution: hass commentedThis is not an API function for the link module, that other modules can call.
Comment #8
barraponto CreditAttribution: barraponto commentedIsn't there a PHP library for that? Something that can figure out domain names, build queries (?) and fragments (#), and all sorts of stuff we might be duplicating here?
Comment #9
areikiera CreditAttribution: areikiera commentedAny progress on this?
Comment #6 is a patch to LinkChecker. Should that patch be provided here (http://drupal.org/node/1546954), and perhaps updated for the most recent version of LinkChecker? Or is this still primarily a Link module issue?