If using the option to 'Restrict allowed view modes for Image', when inserting an image via wysiwyg the preview is using the view mode returned by variable_get('media_wysiwyg_wysiwyg_default_view_mode', 'full'), which might not be an available view mode if it has been restricted.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drasgardian’s picture

bneil’s picture

Component: Code » Media WYSIWYG View Mode
gmclelland’s picture

This worked for me. Thank you It prevents the media_wysiwyg_view_mode dialog from initially show a huge preview image. Instead it shows the a file icon with a link, which is the way it used to work.

The problem can be seen on simplytest.me with the https://drupal.org/project/media_dev
Simply embed an image using the wysiwyg on an article. In the dialog the image will be really big initially until you change the ajaxed view mode select dropdown.

gmclelland’s picture

David_Rothstein’s picture

Status: Closed (duplicate) » Needs review
FileSize
1.22 KB

That issue is about going back into the media dialog after the image has already been placed, but this is about initially inserting the image and is still reproducible.

Here's an updated patch, taking the changes that were committed in #2155931: Media Wysiwyg View Mode Preview Image doesn't remember the View Mode of the embedded media into account.

ksiebel’s picture

I have fixed this issue by setting the variable.

For example:
drush vset media_wysiwyg_wysiwyg_default_view_mode "wysiwyg"

Dave Reid’s picture

Status: Needs review » Fixed

I believe this is resolved with #2158177: Confusing UI for WYSIWYG view modes now.

Status: Fixed » Closed (fixed)

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