I've just encountered this problem. That If i set in the edit atom properties a link that has more than one GET parameters in it, then the link and the options therefore will contain the & sign.

Example:
<div class="dnd-widget-wrapper context-custom_representation type-image"><div class="dnd-atom-rendered">[scald=1227:custom_representation {"link":"http://example.com?ua=1&ua=1"}]</div></div>

Now when in mee_filter_process it calls
$fragment->appendXML($html);
Then that will return with FALSE, cause the & is not valid in xml to be standing alone.

And then the node will be replaced with an empty fragment. Basically the image will not appear.

One possible solution is to escape the string with php before appending as XML.

Maybe there are other ways to append the html?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nagy.balint’s picture

Status: Active » Needs review
FileSize
709 bytes

This patch will likely fix the problem.

According to http://stackoverflow.com/questions/4400980/how-to-insert-html-to-php-dom...
The solution by Gordon.

Even with that solution the warnings had to be disabled with libxml_use_internal_errors(true);, as that only warns that the loaded snippet is not fully xml valid, but that is not a big deal for us, since we know that it is not.

gifad’s picture

Another (safer ?) solution is to encodeURIComponent the options...

gifad’s picture

FileSize
1.65 KB

Same as #2, with less intrusive, and more consistent encoding/decoding (limited to url link of scald_image)

gifad’s picture

FileSize
1.72 KB

Don't decode empty (undefined) value...

  • nagy.balint committed 0073ba6 on 7.x-1.x authored by gifad
    Issue #2472223 by gifad, nagy.balint: Widget filter will not work if...
nagy.balint’s picture

Status: Needs review » Fixed

Thanks, Committed.

This is however not a backward compatible fix, but i think this is the proper way to store the url actually. Maybe this will fix also the " Convert URLs into links" issue where the link in the options was converted into a link breaking the markup?

And since its very easy to change on old code (just need an urldecode call) I think it will be enough to put this into the release notes, maybe we can create a change note as well.

Status: Fixed » Closed (fixed)

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