The current javascript tries to replace every instances of "[[*]]". The current tag has a type attribute that can be used to only apply this where it is needed.

The way media module handle attributes in tags is really clean and could be a best practice. That's why I followed the same principle and created a custom filter for [[{"type":"node", "nid":"5"}]]. This is where I faced this issue.

Maybe this approach could be documented in the "examples" modules after this is fixed.

Patch following

CommentFileSizeAuthor
#1 wysiwyg_media_replace-1314266-1.patch523 bytesidflood

Comments

idflood’s picture

Status: Active » Needs review
StatusFileSize
new523 bytes
dave reid’s picture

Issue tags: +needs backport to 1.x
dave reid’s picture

Should this also be fixed in the PHP versions in media.filter.inc?

idflood’s picture

Status: Needs review » Needs work

@Dave Reid: Oh you are right. There are a couple of regex that should probably be corrected there. This didn't caused issues on the specific setup where this bug has been found but it will be cleaner if they are fixed. The problem is that I don't like regex, so I'm not sure how to properly fix them.

dave reid’s picture

aaron’s picture

Apparently there has been a lot of work in the modules since this issue was reported. The patch no longer applies.

mengi’s picture

Status: Needs work » Needs review
Issue tags: -needs backport to 1.x, -7.x-2.0 alpha blocker

EDIT:
Please ignore, sorry.

Status: Needs review » Needs work
Issue tags: +needs backport to 1.x, +7.x-2.0 alpha blocker

The last submitted patch, wysiwyg_media_replace-1314266-1.patch, failed testing.

dave reid’s picture

Status: Needs work » Closed (cannot reproduce)

I cannot find where this code lives anymore. I'm going to just close it out.