Closed (fixed)
Project:
Pathologic
Version:
7.x-1.4
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
28 Sep 2011 at 08:56 UTC
Updated:
27 Jul 2012 at 06:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
SolomonGifford commentedI got this with a brand new install
Comment #2
Garrett Albright commentedNeed a little bit more info. What text are you trying to filter? How have you configured the module?
Comment #3
thekevinday commentedThis seems to happen to me during the following situation:
I am building a page that provides a table using drupals theme_table().
Random nodes will have the said problem.
I put a watchdog command inside of the _pathologic_replace() function and found that in all cases where the error appeared, the matches array had the following content:
Array ( [0] => href="/" [1] => href )As a temporary workaround to at least silence the errors until a proper solution can be found, try the attached patch.
Comment #4
cobadger commentedI'm getting the same error using module 'html mail':
Notice: Undefined offset: 2 in _pathologic_replace() (line 118 of /[path to drupal root]/sites/all/modules/pathologic/pathologic.module).
Notice: Undefined offset: 3 in _pathologic_replace() (line 122 of /[path to drupal root]/sites/all/modules/pathologic/pathologic.module).
Notice: Undefined offset: 2 in _pathologic_replace() (line 118 of /[path to drupal root]/sites/all/modules/pathologic/pathologic.module).
Notice: Undefined offset: 3 in _pathologic_replace() (line 122 of /[path to drupal root]/sites/all/modules/pathologic/pathologic.module).
Notice: Undefined offset: 2 in _pathologic_replace() (line 118 of /[path to drupal root]/sites/all/modules/pathologic/pathologic.module).
Notice: Undefined offset: 3 in _pathologic_replace() (line 122 of /[path to drupal root]/sites/all/modules/pathologic/pathologic.module).
Using html mail configured with "Busy" theme, post-filtering set to "HTML mail" where "HTML mail" is a text format set up as shown here:
http://drupal.org/node/1130960
I do not get these errors with post-filtering set to 'unfiltered' (but resulting html email does not look like my website).
Comment #5
Garrett Albright commentedI never could replicate this, but I just made a new release which uses this patch created by Zombienaute. (Are you all using Windows hosts, by the way?) I encourage you all to give it a try. I'll close this issue for now; if it pops up again, feel free to re-open.
And slown, for future reference, please don't assign issues to yourself when you create them, unless you intend to provide a patch for the bug/feature/etc.
Comment #6
thekevinday commentedI was hoping this was resolved in 7.x-1.4, and then I noticed the error in my watchdog logs again.
For now, I am stuck with using my workaround patch from #3.
For the record, I am on a Redhat Linux host.
Comment #7
Garrett Albright commentedthekevinday: I don't see where Pathologic comes into play with regards to the code you posted. Could you maybe post the text that Pathologic is trying to work on which is causing the failure?
Comment #8
bensnyder commentedGetting this too
D 7.9
Pathologic 7.x-1.4
Comment #9
shane birley commentedI am seeing this error with the latest verison, 1.4 - but I am NOT on Windows.
Comment #10
netsensei commentedSeeing the same error.
How to reproduce:
1. Install Pathologic.
2. Create a block (or add a node) and enter this piece of content: Test
3. Notice how Pathologic fails
I have one block with this kind of code. As soon as I remove it, the errors are gone.
The patch in #3 is a good start.
To make matters more complex: my use case is a multilingual site so the patch only solves this partly.
1. It generates links like http://www.example.com/fr//
2. When you switch languages, it fetches the link which is stored in the cache. Unless you create a block which is language-agnostic and is shown on each language, it will show the link to the wrong language (i.e. http://www.example.com/fr// on the dutch version). One has to create a block per language... but with the same HTML code to make sure pathologic renders the correct links.
So, you can't solve this without solving #348421: Multilingual links with Pathologic first imho.
Comment #11
Garrett Albright commentednetsensei: The code you want me to test just renders itself as HTML, but I'm assuming it was something like
<a href="/">Test</a>, right?When I do something like that, I can replicate the error. Thanks. I think that paths consisting of just a slash should pass through Pathologic unaltered, since technically they begin with a slash.
I think the approach that I'm currently using with that Monster Regular Expression of Doom is starting to show its brittleness. Perhaps it's time for a new approach. And all these holidays coming up… hmm.
Is this also happening for anyone with paths other than just "/"?
Comment #12
netsensei commentedYes. Correct. I noticed the HTML got mangled without the code tag here. I've only noticed this problem with / not with anything else. Might be worth, testing it with
<a href="#">test</a>too. But that shouldn't raise a problem I think.Comment #13
bryancasler commentedgetting a bunch of these now after upgrading the module
Comment #14
bryancasler commentedcorrecting the priority on this
Comment #15
amir simantov commentedSame here - these two errors. After reading this thread I still do not understand what should I suppose to do...
Any help? Thanks!
[Project: Aviram]
Comment #16
Garrett Albright commentedHmm, these are probably unrelated to the original problem for which this issue was created months ago… Could you post a sample of text which is causing this error to appear after you run it through Pathologic, please?
Comment #17
amir simantov commentedHi Garrett.
Thanks for your comment. Here is what I get:
Notice: Undefined offset: 2 in _pathologic_replace() (line 117 of [...]/sites/all/modules/pathologic/pathologic.module).
Notice: Undefined offset: 3 in _pathologic_replace() (line 121 of [...]/sites/all/modules/pathologic/pathologic.module).
Comment #18
Garrett Albright commentedThanks, but what I meant is, could you give me some text you're trying to run through the filter which is causing this error?
Also, could you try updating to a 7.x-2.0 release and let me know if that helps you?
Comment #19
geek-merlini can confirm that
* 1.4 shows this notice
* and latext 2.x dev stops that.
Comment #20
samwillc commentedI can also confirm that I get no more undefined property errors using 2.x dev version.
Thanks for the update :)
Sam.
Comment #21
Garrett Albright commentedWith the full release of 7.x-2.0 (finally!), I'm closing this issue.