Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When an image is uploaded via the WYSIWYG integration it is stored like this:
[[{"type":"media","view_mode":"media_large","fid":"50151","attributes":{"alt":"","class":"media-image","height":"108","typeof":"foaf:Image","width":"480"}}]]
For some reason that turns into the following in the WYSIWYG editor.
<span id="styles-1-0" class="media-image media-element file-media-large" data-file_info="%7B%22type%22:%22media%22,%22view_mode%22:%22media_large%22,%22fid%22:%2250151%22%7D"> <img id="1" src="http://example.com/files/styles/medium/public/something.png" alt="" /></span>
Note that the image style on the nested img tag is "medium" and not "large" as is currently configured on the site.
Comments
Comment #1
DamienMcKennaClarification: the 'large' file display uses the 'large' image style while the 'default' file display uses the 'medium' image style.
Comment #2
gmclelland CreditAttribution: gmclelland commentedSee #2048389: InsertMedia does not work in CKEditor when inserting it within existing paragraph. for a similar problem
It looks like your media tags are getting messed up by the wysiwyg editor which is causing the incorrect markup to output.
I would try using TinyMCE 3.5.8 with wysiwyg module and see if that helps. I had problems when using ckeditor.
Comment #3
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedClosing this issue as outdated. However, if you think this issue is still important, please let us know and we will gladly re-open it for review.
sincerely,
- the Drupal Media Team