Closed (fixed)
Project:
Link checker
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jan 2012 at 19:21 UTC
Updated:
10 Feb 2012 at 20:00 UTC
Link fields using the link module (drupal.org/project/link) are not being checked (both internal and external links).
When the function linkchecker_parse_fields() is called, the link markup added to the $text_items[] array doesn't seem to be valid for later checking in _linkchecker_extract_links().
Here is an example of what ends up being added:
<a href="<a href="http://drupal.org/a/broken/link/example">http://drupal.org/a/broken/link/example</a>">http://drupal.org/a/broken/link/example">http://drupal.org/a/broken/link...</a>
Instead of calling _filter_url() and then _linkchecker_check_markup(), would it make sense to call Drupal's l function instead? That way, both internal and external links are converted into valid markup which can be read by _linkchecker_extract_links().
Comments
Comment #1
hass commentedComment #2
hass commentedLet's try it this way: http://drupalcode.org/project/linkchecker.git/commit/76d2272
It seems difficult to re-use a formatting function like
theme_link_formatter_link_default()from link module.This fix also change logic; if urls are extracted compared to past code. In past all the link module fields have been forced to full qualified urls and therefore became "external", nevertheless it may was an internal link (e.g. "node/80") only. Now the internal/external url extraction is detected as in all other code.
Internal Drupal URLs with params like
node/80?foo=barhave also not been loaded with alias/drupal7/node-80-foo?foo=barproperly. This is required, because url() does not support relative URLs containing a query string or fragment in its $path argument. Instead, any query string needs to be parsed into an associative query parameter array in $options['query'] and the fragment into $options['fragment'].May should get a backport for consistency reasons...
Comment #3
hass commentedComment #4
ccarigna commentedTested the latest build and it works as expected. Thanks!