When a site was moved from root to subdirectory (http://www.example.com to http://www.example.com/subdir), pathologic settings were edited: http://www.example.com/ and http://www.example.com/subdir/ were added to the "All base paths" and then caches cleared.
Pathologic was expected to process links properly. However, links that were absolute (e.g. href="http://www.example.com/sites/default/files/image.jpg"), were not corrected (i.e. to the expected "http://www.example.com/subdir/sites/default/files/image.jpg" ).
Comments
Comment #1
iva2k commentedInspecting the code I was able to trace the problem to the way 'local_paths_exploded' is built in function _pathologic_filter(). The monster "if" statement inside "foreach ($local_paths as $local)" discards the case of "http://www.example.com/" because it has same 'host' but different 'path' as in $base_url_parts.
The fix that resolved this issue is adding
into that monster "if" statement before the closing paren, making it a bit bigger.
Comment #2
Garrett Albright commentedI was able to replicate the bug and get a fix in place. It'll be in the next point release, or give the dev release a try. Thanks for bringing this to my attention!
Comment #3
iva2k commentedThanks, that was quick!
I tried the -dev, and it indeed fixed the case when http://www.example.com/... was not changed to http://www.example.com/subdir/...
However I have to reopen as the other case is broken now:
http://www.example.com/subdir/... becomes http://www.example.com/subdir/subdir/...
(actually I did not try it before, maybe it was broken all along).
Comment #4
stewart.adam commentedI can confirm that this issue is not resolved either. Patholigic is not fixing image paths for me when my Drupal install is in a subfolder (e.g.
<img src="sites/default/files/image.png" />in a Full HTML block).Comment #5
Garrett Albright commentedstewart.adam, does it look like you're having the same problem mentioned in this issue? If so, could you try downloading and running the 7.x-2.x-dev development release and let me know if it fixes the issue for you?
Comment #6
Garrett Albright commentedMarking as fixed for now. Please update if needed.