I'm using:

Drupal 7.4
Insert 7.x-1.1
Wysiwyg 7.x-2.1 with CKeditor

to create a node (full HTML) with an inline image (and a hidden image field).

Filter processing order is:

Convert media tags to Markup
Convert URLs into Links
Convert line breaks into HTML
Convert faulty and chopped off HTML
Correct URLS with Pathologic

Without Pathologic the HTML for the inline image is:

<img alt="" src="http://local.drupal7/sites/default/files/1107.jpg" title="" height="596" width="781" />

and the node displays correctly. There are no other links in the node.

With Pathologic, I get the error:

Warning: preg_replace_callback() [function.preg-replace-callback]: Unknown modifier ' ' in _pathologic() (line 108 of C:\xampp\htdocs\drupal7\sites\all\modules\pathologic\pathologic.module).

and the node does not display.

Am I doing something wrong or should i be raising this as a bug?

CommentFileSizeAuthor
#13 1226926-windows-error-fix.patch698 bytesacbramley

Comments

atiras’s picture

Update: this happens with the latest dev version of Pathologic; and also when the Insert module is disabled.

hctom’s picture

subscribing... I have the same issue and just Pathologic and Linkit enabled.

hctom’s picture

... and a little follow up:

I just tested the latest 7.x-1.0-dev.. the only file that is changed compared to the stable 7.x-1.2 release is the pathologic.test module... but the error disappears... unfortunately it outputs no readable-urls, even though my site is configured to do so...

So this is really strange as the test fiel should not have anything to do with executing the filter.

Cheers

hctom

hctom’s picture

Okay... now I'm REALLY confused... reverted back to 7.x-1.2 and the error is gone, too... Don't ask me, what happened, that it is running now.

I have an idea: it seems to have something to do with features... beacause the "?q=" urls were fixed after saving the clean URLs form manually... And I also saved my text format form manually again, even though it is packed by the feature.

Garrett Albright’s picture

Slow bad module maintainer Albright here… Is this still a problem for you guys? I can't imagine what could be going wrong here - there's only one modifier in question, and it should be readily apparent.

sniffypup’s picture

Version: 7.x-1.2 » 7.x-1.3

I get the same error with 7.x-1.3 on drupal 7.7, except the error message now refers to line 110.

My local site was built with pathologic enabled but without the text format edited to invoke the url correction by pathologic. As soon as that is ticked (and pathologic is the last in the processing list), the errors arise and persist, with the displays not functioning.

Any suggestions yet? Thanks in anticipation.

Garrett Albright’s picture

sniffypup and/or hctom, would you mind sharing what you have for your "Also considered local" value, and also a bit of text you're filtering where this problem is happening?

hctom’s picture

Hi Garret,

I used a dummy text like this one with nothing special in it:

Maecenas auctor, turpis quis egestas vestibulum, nunc diam malesuada metus, id ultrices ipsum nisl vel quam. Pellentesque ac justo a metus tincidunt dignissim. Phasellus quis ligula luctus nisl posuere aliquet nec at ipsum. Suspendisse quis leo ante, eu commodo turpis? Praesent faucibus purus dignissim massa aliquet facilisis. Quisque malesuada nunc nec lorem egestas eget porttitor nulla laoreet. Quisque magna arcu, mollis sit amet convallis in, tristique a ipsum. Donec a sem luctus felis congue aliquam in aliquam dolor.

And then I marked some of the words and added a linkit link to a node.

Hope this helps?

Cheers

hctom

Garrett Albright’s picture

hctom, do you have anything set for "Also considered local" for the text format in question?

hctom’s picture

No... I only used the default settings with Pathologic and Linkit.

k0teg’s picture

Just remove newline character after ~x in _pathologic().

Replace this:

      'pattern' => '
        ~(href|src|action|longdesc|HREF|SRC|ACTION|LONGDESC)=" # HTML attributes
                                                                 # to search for
        (internal:|files:|' . implode('|', $paths) . ')?      # Path prefixes to
                                                                     #search for
        (?:
          /(?:\#.*)?|            # A / path with a possible anchor fragment, or…
          (?!(?:\#|/|(?:' . $proto_prefixes . '):/))  # Exclude likely protocols
          (?:(?:index\.php)?(?:\?q=)?) # Allow for paths which include index.php
                                                                    # and/or ?q=
          ([^"]*)                                       # Finally, get the path.
        )"~x
      ',

with this:

      'pattern' => '
        ~(href|src|action|longdesc|HREF|SRC|ACTION|LONGDESC)=" # HTML attributes
                                                                 # to search for
        (internal:|files:|' . implode('|', $paths) . ')?      # Path prefixes to
                                                                     #search for
        (?:
          /(?:\#.*)?|            # A / path with a possible anchor fragment, or…
          (?!(?:\#|/|(?:' . $proto_prefixes . '):/))  # Exclude likely protocols
          (?:(?:index\.php)?(?:\?q=)?) # Allow for paths which include index.php
                                                                    # and/or ?q=
          ([^"]*)                                       # Finally, get the path.
        )"~x',
Garrett Albright’s picture

Woah, really? That works? I wonder why… I've still never been able to replicate it. k0teg and others in this thread who are having this problem, are you using a Windows-based server like the original poster? I currently don't have access to a Windows-based box to test with myself.

acbramley’s picture

StatusFileSize
new698 bytes

This bug was affecting a designer for our site pretty severely. He wasn't able to save any content in a wysiwyg on a node and was getting about 100 lines of errors on a page. This patch fixed all of that for him

Garrett Albright’s picture

Okay, and just to confirm, this designer is using Windows? (Although what is a designer doing using Windows?!)

acbramley’s picture

Yes he's using Windows (unfortunately :P). He hasn't been able to get hold of a decent Apple and needs the adobe suite :)

Garrett Albright’s picture

Okay, that seems to indeed be the common theme here. Thanks for the patch. I pushed it into the repo, but I'm afraid I'm too conked to go the full way and make a release tonight. But if anyone out there having this problem can try the latest devel release (assuming it was built some time after the post time on this post) and let me know if it fixes things, I'd greatly appreciate it.

Sorry for not believing you all… :P I've never heard of a regular expression working on POSIX but breaking on Windows before.

Garrett Albright’s picture

Status: Active » Fixed

Okay, that silence was disheartening, but I went ahead and made a new release anyway. I'll close this issue for now, but feel free to re-open it if this problem is still happening for you folks. Otherwise, thanks again, Zombienaute.

acbramley’s picture

No problem :)

Status: Fixed » Closed (fixed)

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