Hello. I'm the developer of Pathologic, a module which, in its earliest versions, pretty much did the same thing Path Filter does, but without the "internal:" prefix -- it instead uses simple heuristics to determine if a path is relative or not. Needless to say, I was unaware of Path Filter's existence when I first started working on the project; however, it has recently been brought to my attention.

In the interest of not having two modules out there that pretty much do the same thing, it's been suggested that I join forces with the Path Filter team instead of continuing to develop my own module. It's not a bad idea, but frankly, Pathologic has advanced with successive versions, and its capabilities are now quite above and beyond what they originally were… or what Path Filter can currently do. In other words, aside from the "internal:" thing, there's nothing Path Filter does that Pathologic doesn't. (Oh, and Path Filter has a D4.7 version…)

So I'm not sure how these modules can combine other than taking Pathologic's code, adding compatibility for Path Filter-style paths (basically, just tweaking the RegEx and telling it to ignore the "internal:" at the beginning of HREF or SRC attribute), then releasing it under the name of either Pathologic or Path Filter and killing off whichever name doesn't get picked.

Sorry if this comes off a bit as saying "My module's better than yours, neener neener" but if you just check out the source code, I think you'll agree…

Your thoughts?

Comments

mrfelton’s picture

Hi. I've just taken over development of this module, since I use it on all of my sites and it had seemed to be abandoned for almost a year, despite the fact that over 1000 people are using it! Anyway, I hate having two modules doing essentially the same thing, and can see no logical reason why both of these modules should co-exist. Eventually, I would like to see these two modules rolled into one. I haven't taken a look at pathologic properly yet, but at a first glance it certainly does seem further down the road and more complete than this one.

Clearly, a lot of people, including myself, use Path Filter, and so whatever results from this discussion, needs to continue to support the internal: way of doing things. There have been noises about getting an [internal] filter into core (http://drupal.org/node/402296), which I think is great since every site surely needs a solid way of providing internal links and this is something that bites many people when they discover they have done it incorrectly (links relative to local staging environment, absolute links, linking to alias etc etc)...

One of the new developments I started working on right before I discovered this ticket was #127484: [Push #2] pathfilter for files directory which will be a really nice addition, giving the ability to link cleanly to files using a files: syntax.

Wow, just realised this ticket is almost a year old!

So anyway... still up for a merger?

Garrett Albright’s picture

Thanks for pointing out that core issue; I've posted my thoughts on it.

I haven't worked on this module in quite a while, but I still think a merger of some sort would be a good idea, yes. But I'm afraid I'm not going to give in on the idea of keeping the usage of tokens like internal: in the codebase… Are we at an impasse on that point?

As I said in the OP, I think it would be fairly easy to just tweak Pathologic so that it ignores "internal:" at the beginning of paths it examines. That would be an easy solution to keep backwards compatibility with all nodes with "internal:" already strewn about in their text.

Garrett Albright’s picture

As I said in the OP, I think it would be fairly easy to just tweak Pathologic so that it ignores "internal:" at the beginning of paths it examines. That would be an easy solution to keep backwards compatibility with all nodes with "internal:" already strewn about in their text.

For the record, Pathologic now does this. Those wishing to migrate from Path Filter to Pathologic should now be able to do so transparently without having to tweak their content.

However, I'm getting some gruff from someone considering switching about another difference between Path Filter and Pathologic, that being that Pathologic outputs full URLs with the protocol fragment while apparently Path Filter outputs simple absolute URLs beginning with a slash. This is causing problems when data cached via HTTP is served via HTTPS or vice versa: see #516294: Can pathologic alter img src paths to be HTTPS if the page is served out HTTPS? for the sad story. This may be cause for someone to use Path Filter instead of Pathologic.

mrfelton’s picture

Path filter gives you the option to choose to use absolute urls or absolute paths. I'm still up for merging these modules, or, pathologic clobbering path filter as you put it. But I think that the SSL issue needs to be addressed. Perhaps you could also give your user the option to chose what kind of links are output?

yan’s picture

Any progress on this issue? I'm wondering if I should use Path Filter or Pathologic now. The latter seems more advanced to me, but I'm not sure.

Garrett Albright’s picture

You should use Pathologic. Though, as the developer of Pathologic, I'm a bit biased… :P

I will say that Pathologic is designed to work with paths with Path Filter's "internal:" prefix. So if you try Path Filter and decide you don't like it, you'll be able to switch to Pathologic without having to change any of your paths. However, it won't work the other way; if you try Pathologic and decide to switch to Path Filter, you'll have to go through and add the "internal:" prefix to your paths.

colan’s picture

Title: Pathologic and Path Filter » Merge Pathologic and Path Filter
Version: master » 7.x-1.x-dev
Component: Code » Documentation
Status: Active » Needs review

I think it's about time we deprecate Path Filter in favour of Pathologic. There does not appear to be any development activity (or even a release) for a Drupal 7 version of Path Filter.

Thoughts?

mrfelton’s picture

I tend to agree

colan’s picture

Status: Needs review » Reviewed & tested by the community

@mrfelton: As you're the maintainer, could you set the module status to "Deprecated" and put a note in the description (at least for Drupal 7+)?

Then we can close this ticket. :)

colan’s picture

Title: Merge Pathologic and Path Filter » Deprecate Path Filter in favour of Pathologic

Updating title.

mrfelton’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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