Pathologic does not need the internal: prefix of link addresses and should not generate this by default. This is a patch is for linkit and linkit_node. We need more patches for taxonomy, views.

This keeps the backwards compatibility with internal: prefix so if the users already have internal: links, linkit will recognize them but alter them if they are updated by the user.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

anon’s picture

Status: Patch (to be ported) » Needs review
betamos’s picture

betamos’s picture

FileSize
2.52 KB

Here's the patch for both linkit_taxonomy and linkit_file.

betamos’s picture

And here is the patch for linkit_user.
If everything works out as expected, I will commit these files in the same commit.

betamos’s picture

FileSize
1.51 KB

Forgot file :)

betamos’s picture

FileSize
5.21 KB

Here's a unified patch which contains all of the above.

anon’s picture

@Betamos, can you make that work with CVS?

betamos’s picture

Windows noobs must be able to apply both git and CVS patches :) @see http://drupal.org/patch/create

I used git diff --no-prefix which makes it compatible with CVS.

anon’s picture

FileSize
7.06 KB

Fixed some performens issues, and made the code more simple (still awesome tho)

Try this against the lastest version from CVS (DRUPAL-7--1)

Its based on the patch from #6

timwood’s picture

Will this be applied to the 6.x series? Does Pathologic for 6.x do the same?

anon’s picture

@Timwood: Not sure if we would implement this on 6.X.

Why we do this for 7.X is that pathfilter isnt compatible with Drupal 7, so that leave us with only one choice, pathologic.
And then "internal" feels overkill to use, as it isnt needed.

betamos’s picture

@Timwood Pathologic works the same way in D6 but Linkit for D6 depends on either pathologic or pathfilter (which imo may be questioned, pathologic is better) but we can't apply this patch on D6 since it wouldn't be compatible with pathfilter (as anon says).

@anon I will try this patch as soon as I can.

timwood’s picture

Thanks for the quick responses. Glad to see this project has two very active maintainers. Two followup questions:

1. What does the html code that linkit outputs look like without the internal: prefix? Relative, absolute, something else?

2. Depending on the answer to question one above, would there be any value in porting this to the 6.x series with an admin screen option to turn it on and off? Or would that be too much extra coding/work and possibly lead to user confusion and support requests?

anon’s picture

@timwood

1. The html itself hasnt changed. Its still <a href="node/123">example</a> but the "internal:" in the href-attribute is gone.

2. Like you said, I think that would cause user confusion and support requests, but if I have time, or someone else patches it I will look at this for sure.

betamos’s picture

An addition to @anon's answer: The html generated by Linkit, which you see in your WYSIWYG editor and which is also stored in the database is <a href="node/123">example</a>. However, the Pathologic filter is converting this into either a relative (Drupal root) or an absolute (http) URI; this is configurable! Check Pathologics filter settings, there is an "Output full absolute URLs" option there.

My opinion on question 2 is that it we either should drop support for Pathfilter in D6, if we ever start building on a new major release there... Or we could make it user configurable, but it would not be our highest priority then, since it still works fine with "internal:" prefixes in most cases. But patches are always welcome :)

betamos’s picture

@anon included other stuff in his patch in comment #9. This patch fixes that and is is a reroll against CVS 7.x-HEAD as of this date/time.

betamos’s picture

New patch, forgot to remove internal: in one place. Will commit this now.

anon’s picture

Status: Needs review » Reviewed & tested by the community
betamos’s picture

Status: Reviewed & tested by the community » Fixed

Committed against 7.x-1.x-dev

Status: Fixed » Closed (fixed)
Issue tags: -filter, -pathologic, -pathfilter, -internal link

Automatically closed -- issue fixed for 2 weeks with no activity.