Hi,
Using the latest dev version of media 2.x, when inserting a media in a wysiwyg (using Ckeditor 4), if I look at the source the markup is the following :
[[{"fid":"41","view_mode":"default","fields":{"format":"default"},"type":"media","attributes":{"class":"media-element file-default"}}]]
Which is expected. But when I resize the media and check the source the markup has been changed to :
<img alt="" class="media-element file-default" data-file_info="%7B%22fid%22:%2241%22,%22view_mode%22:%22default%22,%22fields%22:%7B%22format%22:%22default%22%7D,%22type%22:%22media%22%7D" height="365" src="****" width="292">
And that is then saved, instead of keeping the correct media markup.
Comments
Comment #1
huteb CreditAttribution: huteb commentedComment #2
huteb CreditAttribution: huteb commentedSeems to be related to https://drupal.org/node/2075123 . That issue concerns insertions, which now works, but resizing brings the issue back.
Comment #3
bneil CreditAttribution: bneil commentedAre you using the WYSIWYG module + Ckeditor 4 library, or the Ckeditor module + Ckeditor 4 library?
Here's an issue that is tracking WYSIWYG compatibility: #2067325: [META] Tracking WYSIWYG compatibility .
If you're using the Ckeditor module, I suggest following #1504696: Integration with CKEditor module.
Also, have you tried any of the patches of the child issues of #2067063: Wysiwyg integration is broken? Specifically #2126755: Improve Media's WYSIWYG Macro handling could help.
Comment #4
huteb CreditAttribution: huteb commentedI'm using WYSIWYG module + Ckeditor 4 library, sorry for not specifying this previously.
based on the #2067325: [META] Tracking WYSIWYG compatibility issue I revertef Ckeditor to version 4.0.3 which is supposed to work correctly, and I applied the patch #19 found in #2126755: Improve Media's WYSIWYG Macro handling.
Now the markup is not replaced by an IMG tag on resize, but the height and width are not added to the markup, so resizing isn't saved.
Comment #5
huteb CreditAttribution: huteb commentedMy bad! The problem was actually that I was using the Shadowbox formatter when displaying images in the wysiwyg editor. I set it to the basic image formatter and now it works.
But it only works ckeditor 4.0.3 and the aforementionned patch.
Comment #6
mglamanClosing this as original issue was due to the formatter set on the entity's view mode (maybe need to open issue that images should be forced to default in WYSIWYG? or is this already in place?.) #2126755: Improve Media's WYSIWYG Macro handling is now RTBC (#4) states helped solve issue.