Closed (fixed)
Project:
D7 Media
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Nov 2012 at 20:05 UTC
Updated:
6 May 2013 at 16:42 UTC
I noticed with the latest -dev that when I try to embed an image into a WYSIWYG it displays (post save) as "false". I traced this back to the "Verify HTML" setting in TinyMCE and further back that the WYSIWYG isn't allowed Media's special tags. This change came about with #1451316: Clean up wysiwyg-media.js and is fixed (in my custom module) by adding $settings['extended_valid_elements'] .= ',img[src|view_mode|format|fid]'; to the TinyMCE extended valid elements through the WYSIWYG settings alter hook.
My guess is the logic in media_include_browser_js() might need to be modified, but not quite sure the approach that is being taken.
Comments
Comment #1
mrfelton commentedThe mentioned hack/workaround worked for me, although my media embeds now just seem to be inserting plain old img tags, as opposed to [[media]] embeds. But I suspect thats another issue.
Comment #2
ParisLiakos commentedIs there any way yet to reproduce this with a lean latest dev?
Comment #3
mrfelton commentedI found that in my case the problem exists with tinymce 3.5.7, but not with tinymce 3.4.9. Switching to the older version of tinymce seems to fix this, as well as the other issue I described in comment #1 (media embeds inserting plain old img tags, as opposed to [[media]] embeds)
Comment #4
pdcrane commentedI had this same problem after updating Media module to 7.x-2.0-unstable7 (from unstable6)
My fix: I discovered that the Filter Processing Order on my Text Filters needed to be adjusted so that Parsing Media tags had top priority. (admin/config/content/formats > configure)
This resolved the issue on two separate sites producing the same error as the OP, without using the proposed workaround.
Not sure if it's a fix for everyone, but it may help others searching for the same issue.
I'm not proficient with PHP, but a proposed fix would be to ensure that Media gives itself priority in Text Filter's processing (-50 row weight)
Comment #5
btc97 commentedSame for me. Hack ensures the image embeds, but image properties set through TinyMCE (e.g. Alt, alignment) seem to be lost.
Comment #6
kingfisher64 commented#4 did not work for me. I'm using drupal 7.17, unstable7
I'm getting the "false" output instead of an image.
Solution
Upgrading tinymce to 3.5.8 (latest version at time of writing this) appears to fix the problem.
Comment #7
ParisLiakos commentedSeems this is a tinymce issue which is fixed in latest version..maybe regression?
@mrfelton and others can you confirm 3.5.8 tinymce fixes it, so we can close this and maybe add a note in project page
Comment #8
mschudders commentedConfirmed #6 fixes the issue
Comment #9
mschudders commentedConfirmed #6 fixes the issue
Comment #10
btc97 commented#6 seems to have fixed it for me too.
Comment #11
kingfisher64 commentedUpgrading tinymce to 3.5.8 fixes the problem
Comment #13
jwilson3Same problem is happening with latest CKEditor, and can be fixed in a similar way as #1. See #1963270-5: CKeditor 4 converts Media tags to string "false".
Comment #14
jwilson3Updating title to be more relevant to this specific issue.