Hi,

First of all, thanks for this great module.
I think there is a bug in the following case (I will try to be as clear as possible).

Here is my configuration :

Drupal 6.10 - Apache 2.2.11 on Windows or Apache 2.2.6 on Linux (the issue is the same on both) - PHP/5.2.9 - MySQL

- Input format : "Full HTML" is the only input format, and 3 filters are checked : HTML corrector (core drupal filter), Internal path filter, URL filter (core drupal filter)

- Convert internal paths to : "Absolute URL (including http://www.example.com)" (but the issue is the same with "Absolute path (relative to document root)"

- "Enable automatic url processing for attributes" is checked

- Order of the filters :

1. Internal path filter > weight : -10
2. URL filter > weight : -9
3. Html corrector > weight : -8

- FCKEditor is used but I don't think it is concerned by this issue (please see below)

- the url of my Drupal site is : http://localhost/Drupal

1. I create a new node with 3 url in the content :

- a link to an internal node
- a link to a file
- an insertion of an image

For the first two url, I choose the protocol of the FCKEditor dialog box, so the HTML source code is generated properly :

link to an internal node
link to a file
Only local images are allowed.

2. I save the node. Everything is ok : the links to the internal node and the file work correctly and the image is displayed.

The url on the link to the internal node is : http://localhost/Drupal/?q=node/44

Now let's go to the Mysql database. Here is the content of the body column of the node_revisions table for my node :

link to an internal node
link to a file
Only local images are allowed.

3. Now I edit my node. Here is the HTML source code :

link to an internal node
link to a file
Only local images are allowed.

4. I save my node again (without any modification).

The link to the internal node doesn't work anymore.
(the links to the file and the image are ok)
In the HTML Source code of the displayed page, I can see link to an internal node and my browser of course doesn't know the internal: protocol.
Now let's go to the Mysql database again. Here is the content of the body column of the node_revisions table for my node :

link to an internal node
link to a file
Only local images are allowed.

If you compare the two contents, you can see that "internal:node/44" has been replaced by "internal:?q=node/44" which is the cause of the broken link.

I've tried with my Windows Apache version with clean url activated and everything is ok.
So this bug only occures when clean url are not activated.

I hope this issue will help you in your development.

Best regards,

Laurent

Comments

lo37’s picture

Sorry, I 'm posting this issue again in the comment because the rendering of my first post is not correct. Could you please delete my first post ? Thanks in advance

Hi,

First of all, thanks for this great module.
I think there is a bug in the following case (I will try to be as clear as possible).

Here is my configuration :

Drupal 6.10 - Apache 2.2.11 on Windows or Apache 2.2.6 on Linux (the issue is the same on both) - PHP/5.2.9 - MySQL

- Input format : "Full HTML" is the only input format, and 3 filters are checked : HTML corrector (core drupal filter), Internal path filter, URL filter (core drupal filter)

- Convert internal paths to : "Absolute URL (including http://www.example.com)" (but the issue is the same with "Absolute path (relative to document root)"

- "Enable automatic url processing for attributes" is checked

- Order of the filters :

1. Internal path filter > weight : -10
2. URL filter > weight : -9
3. Html corrector > weight : -8

- FCKEditor is used but I don't think it is concerned by this issue (please see below)

- the url of my Drupal site is : http://localhost/Drupal

1. I create a new node with 3 url in the content :

- a link to an internal node
- a link to a file
- an insertion of an image

For the first two url, I choose the <other> protocol of the FCKEditor dialog box, so the HTML source code is generated properly :

<a href="internal:node/44">link to an internal node</a><br />
<a href="files:myDirectory/myFile.pdf">link to a file</a><br />
<img width="800" height="600" src="/Drupal/sites/default/files/image/myDirectory/1.jpg" alt="" /><br />

2. I save the node. Everything is ok : the links to the internal node and the file work correctly and the image is displayed.

The url on the link to the internal node is : http://localhost/Drupal/?q=node/44

Now let's go to the Mysql database. Here is the content of the body column of the node_revisions table for my node :

<a href="internal:node/44">link to an internal node</a><br />
<a href="files:myDirectory/myFile.pdf">link to a file</a><br />
<img width="800" height="600" src="files:image/myDirectory/1.jpg" alt="" /><br />

3. Now I edit my node. Here is the HTML source code :

<a href="http://localhost/Drupal/?q=node/44">link to an internal node</a><br />
<a href="http://localhost/Drupal/sites/default/files/myDirectory/myFile.pdf">link to a file</a><br />
<img width="800" height="600" alt="" src="http://localhost/Drupal/sites/default/files/image/myDirectory/1.jpg" /><br />

4. I save my node again (without any modification).

The link to the internal node doesn't work anymore.
(the links to the file and the image are ok)
In the HTML Source code of the displayed page, I can see <a href="internal:?q=node/44">link to an internal node</a> and my browser of course doesn't know the internal: protocol.
Now let's go to the Mysql database again. Here is the content of the body column of the node_revisions table for my node :

<a href="internal:?q=node/44">link to an internal node</a><br />
<a href="files:myDirectory/myFile.pdf">link to a file</a><br />
<img width="800" height="600" src="files:image/myDirectory/1.jpg" alt="" /><br />

If you compare the two contents, you can see that "internal:node/44" has been replaced by "internal:?q=node/44" which is the cause of the broken link.

I've tried with my Windows Apache version with clean url activated and everything is ok.
So this bug only occures when clean url are not activated.

I hope this issue will help you in your development.

Best regards,

Laurent

mrfelton’s picture

Assigned: Unassigned » mrfelton

Hi lo37,
Thank you for your incredibly detailed and thorough bug report - these are a rare, but enjoyable occurrence!

I can confirm that the bug you have reported is indeed a bug and I know that the cause of the problem is in the code and not with your configuration. Please bare with me while I try to get this fixed. I had neglected to think about users without clean urls enabled as in all my Drupalling, I have never actually used or seen a setup that doesn't use clean URLs!

Expect to have a fix shortly.

mrfelton’s picture

Status: Active » Needs review
StatusFileSize
new3.81 KB

Please could you try with this patch and let me know how you get on. Thanks

lo37’s picture

Hi mrfelton,

Thank you for the patch and for your quick answer.
By the way, I am a developer too, that's why I try to be as clear as possible when I have to describe a bug ;)
It seems that there is an issue with this patch.
Here is the output of the command line (as you can see, my drupal site is actually named DeltaKnowledgeTest) :

tomcat@lxebanking:/usr/local/apache2php5/htdocs/DeltaKnowledgeTest/sites/all/modules/pathfilter$ ls
644862-pathfilter-clean-urls-disabled.patch  pathfilter.install  tests
LICENSE.txt                                  pathfilter.module   translations
pathfilter.info                              README.txt
tomcat@lxebanking:/usr/local/apache2php5/htdocs/DeltaKnowledgeTest/sites/all/modules/pathfilter$ patch -b < 644862-pathfilter-clean-urls-disabled.patch
patching file pathfilter.module
Hunk #1 FAILED at 136.
Hunk #2 FAILED at 148.
Hunk #3 FAILED at 224.
Hunk #4 succeeded at 249 (offset -7 lines).
Hunk #5 FAILED at 272.
4 out of 5 hunks FAILED -- saving rejects to file pathfilter.module.rej
tomcat@lxebanking:/usr/local/apache2php5/htdocs/DeltaKnowledgeTest/sites/all/modules/pathfilter$ ls
644862-pathfilter-clean-urls-disabled.patch  pathfilter.module.orig
LICENSE.txt                                  pathfilter.module.rej
pathfilter.info                              README.txt
pathfilter.install                           tests
pathfilter.module                            translations

Maybe it's due to a wrong revision of the pathfilter.module file within the 6.x-2.0-beta3 module.

I am not familiar with the patch command line and files but the the revision id of my original pathfilter.module file is :

// $Id: pathfilter.module,v 1.7.2.1 2009/10/17 10:01:13 mrfelton Exp $

And I can see in your 644862-pathfilter-clean-urls-disabled.patch file :

retrieving revision 1.7.2.2
diff -u -p -r1.7.2.2 pathfilter.module
--- pathfilter.module	17 Oct 2009 13:02:09 -0000	1.7.2.2

Hope it helps.

Thanks again,

Laurent

mrfelton’s picture

Status: Needs review » Fixed

This should be fixed in CVS now.

Status: Fixed » Closed (fixed)

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