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?
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | freelinking-regex_fix-1247000-6.patch | 545 bytes | siefca |
Comments
Comment #1
juampynr commentedHi 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
Comment #3
sdk commentedI 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
Comment #4
juampynr commentedsdk, 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.
Comment #5
justmagicmaria commentedHi, 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.
Comment #6
siefca commentedRegexp was evil.
Comment #7
cutmedia commentedpatch in #6 fixed it for me, though only works with the default double bracket mark up
Comment #8
Adamation commentedCan 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.patchWhich resulted in this error
patch: **** strip count l is not a numberSo manually applied it :( - bad practice I know!
Comment #9
gisleComment #10
gisleClosing as a duplicate.