Hi. I'm using Media module with WYSIWYG integration to add images to body text. It inserts tags like the following:
[[{"type":"media","view_mode":"media_large","fid":"286","attributes":{"alt":"","class":"media-image","typeof":"foaf:Image"}}]]

In my text format, if I have the freelinking filter before the media filter, it generates an error when it sees this. If I have it the other way around, the media module seems to strip out the entire line (replacing it with nothing).

Has anyone gotten Media module and Freelinking to work together? Is there some combination of admin settings I can use to make it work? Or, could Freelinking be set to ignore double-bracketed strings that don't match its format and just leave them intact?

CommentFileSizeAuthor
#6 freelinking-regex_fix-1247000-6.patch545 bytessiefca

Comments

juampynr’s picture

Status: Active » Fixed

Hi JustMagicMaria,

Interesting module, I did not have tested it. I have added a condition so if the first character right after the second bracket is not alphanumeric, it is not parsed by freelinking.

I have verified against functional tests that this change does not affect other plugins.

You can see more details at http://drupalcode.org/project/freelinking.git/commitdiff/0e20c07.

I will publish a new stable release next Monday, but you can download the latest dev version at the project page since tomorrow.

Cheers

Status: Fixed » Closed (fixed)

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

sdk’s picture

Status: Closed (fixed) » Closed (won't fix)

I have the same problem!

Plugin Not Found

shows up on the page, when I switch the order of the text formatting filters. If the Media filter is before the Freelinking filter, only the image is shown. I tried it with single bracket configuration in freelinking but to no avail. Any possible fix would be highly appreciated!

sdk

juampynr’s picture

sdk, are you using th lastest version? I thought I fixed it with the commit at comment #1. I would really appretiate if you can either help me reviewing the code.

justmagicmaria’s picture

Version: 7.x-3.0 » 7.x-3.2
Category: support » bug
Status: Closed (won't fix) » Active

Hi, juampy. I have reopened this issue because it still is a problem. (I had switched to the Insert Module instead of Media, so it was a non-issue, but that was not user-friendly enough, so I am back with Media Module.)

I have the Freelinking filter above the Convert Media tags to markup in the Filter processing order and I still get the [Bad Link: Plugin Not Found] text in place of the Media images. (When I have them in the other order, Media Module swallows the Freelinks.) I took a quick look at the commit and I don't see the error but regular expressions make my brain hurt.

I really appreciate you supporting this module, btw.

siefca’s picture

Status: Active » Needs review
StatusFileSize
new545 bytes

Regexp was evil.

cutmedia’s picture

patch in #6 fixed it for me, though only works with the default double bracket mark up

Adamation’s picture

Can also confirm freelinking-regex_fix-1247000-6.patch - 545 bytes worked for me.

However - had trouble applying using GIT - No error messages so not sure what went wrong.

Then used patch -pl < freelinking-regex_fix-1247000-6.patch

Which resulted in this error

patch: **** strip count l is not a number

So manually applied it :( - bad practice I know!

gisle’s picture

Version: 7.x-3.2 » 7.x-3.x-dev
Issue summary: View changes
Status: Needs review » Closed (duplicate)
gisle’s picture

Closing as a duplicate.