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

The 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.

<?php
/**
* Implements hook_wysiwyg_editor_settings_alter().
*
* Needed to fix http://drupal.org/node/1835826.
*/
function cw_media_wysiwyg_editor_settings_alter(&$settings, $context) {
 
$settings['extended_valid_elements'] .= ',img[src|view_mode|format|fid]';
}
?>

Priority:Normal» Major

Is there any way yet to reproduce this with a lean latest dev?

I 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)

I 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)

Same for me. Hack ensures the image embeds, but image properties set through TinyMCE (e.g. Alt, alignment) seem to be lost.

#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.

Priority:Major» Normal

Seems 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

Confirmed #6 fixes the issue

Confirmed #6 fixes the issue

#6 seems to have fixed it for me too.

Status:Active» Fixed

Upgrading tinymce to 3.5.8 fixes the problem

Status:Fixed» Closed (fixed)

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

Same 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".

Title:Problem with "Verify HTML" Filter and WYSIWYG Media IntegrationTinyMCE 3.5.7 converts Media tags to string "false"

Updating title to be more relevant to this specific issue.