Closed (won't fix)
Project:
D7 Media
Version:
7.x-2.0-unstable7
Component:
WYSIWYG integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Nov 2012 at 22:51 UTC
Updated:
8 Aug 2013 at 21:11 UTC
I just updated a site to use unstable7, and it seems a behavior has changed.
Previously, AFAIK, the WYSIWYG media button would insert media assets using the media filter syntax. However, unstable7 seems to be inserting the generated HTML directly. Is this the expected behavior?
Comments
Comment #1
ParisLiakos commentedcheck this issue if this happens on images: #1835826: TinyMCE 3.5.7 converts Media tags to string "false"
Comment #2
Josh Benner commented#1835826: TinyMCE 3.5.7 converts Media tags to string "false" seems specific to TinyMCE's cleanup.
I've dug into the code to understand what's going on with this one. You will see this behavior if the view mode you embed outputs a non-image as its outer element. In my case, I was outputting my image wrapped in a link tag. This was causing the detach to fail to match, so the macro wasn't substituted for the HTML, which resulted in the HTML being saved to the field rather than the macro.
In my case, I'm planning to just output the img without the link (and add the link via JS later), but this may be an issue that crops up repeatedly.
Comment #3
rst commentedI see the same thing with unstable7 when inserting a link to a Document file.
The file display setting for Document is set to "Generic File" in the file type settings.
I am using wysiwyg with CKEditor 3.6.5.
The HTML for the link is placed in the node body instead of the [[media]] tags. Is this intentional?
Comment #4
twodThis happened for me when no formatter was enabled on admin/structure/file-types/manage/image/file-display.
I have no idea why none of them are enabled by default, or where it gets the markup from when none are.
The reason it won't insert a macro tag is that the markup generated when no formatter is enabled doesn't contain the
media-elementclass, so the plugin for Wysiwyg can't recognize the tag.Comment #5
ParisLiakos commentedit inserts markup with a data-file attribute right? check #1942688: Documents embedded in WYSIWYG get converted to HTML by the editor
Comment #6
ParisLiakos commentedah..it has no media-element class..then thats another issue sorry
Comment #7
cbeier commentedI have a similar problem. For me, the integration over the CKEditor module is probably the problem.
If I insert a image, I get the following result:
<p><img alt="" class="media-image attr__typeof__foaf:Image img__fid__5 img__view_mode__teaser attr__format__teaser attr__title__" height="135" src="http://[domain]/sites/default/files/styles/wis_teaser/public/wissenstandsorte_eingang.png?itok=cQMFiZe9" title="" typeof="foaf:Image" width="135" /></p>If I use the WYSIWYG module with CKEditor 3.6.6.1, I get the (expected) result:
<p>[[{"fid":"1","view_mode":"teaser","type":"media","attributes":{"height":88,"width":220,"class":"media-element file-teaser"}}]]</p>But with the WYSIWYG module I have some problems with Panels. So the use of the WYSIWYG module is not a solution for me. :)
Comment #8
gmclelland commentedI had similar problems, see #2028255: ckeditor styles break media module markup. In my case it is changing media's markup to the markup posted in #7 when I apply a style from the ckeditor style dropdown after inserting the media item. Selecting the style, ex. media-right would cause the media markup to become garbled.
Note: I'm using the wysiwyg module with ckeditor library.
Comment #9
drupal_was_my_past commentedI believe this is a WYSIWYG module bug. See #1956778-6: Ckeditor 4.1 ACF for a temporary solution. #1956778: Ckeditor 4.1 ACF is seeking a more permanent solution.