We recently had a case where a content editor was using double brackets "[[ SOME COMMENT]]" for comments in a scientific article. This caused the WYSIWYG editor to display an empty value due to a JSON parsing error (due to line 144 on wysiwyg-media.js). I don't believe this is too much of an edge case either because there are other formats/conventions that rely on double brackets (Wiki format for links).

Enclosed is a patch that seems to solve the problem. It modifies wysiwyg-media.js with a try/catch around where the JSON parsing happens. If it doesn't parse, it moves on. Could someone with more knowledge with the media module review?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

JacobSingh’s picture

Status: Active » Needs review
JacobSingh’s picture

Status: Needs review » Fixed
FileSize
1.11 KB

This looks really good. Thank you. I committed the attached (slightly rerolled). In the future, you should roll your patches from the base of the module itself (i.e. media).

Best,
Jacob

Status: Fixed » Closed (fixed)

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