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.
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.
Comment | File | Size | Author |
---|---|---|---|
#5 | media-preview-doesnt-respect-restricted-view-mode-2149315-5.patch | 1.22 KB | David_Rothstein |
#1 | media-preview-doesnt-respect-restricted-view-mode-2149315-1.patch | 839 bytes | drasgardian |
Comments
Comment #1
drasgardian CreditAttribution: drasgardian commentedComment #2
bneil CreditAttribution: bneil commentedComment #3
gmclelland CreditAttribution: gmclelland commentedThis 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.
Comment #4
gmclelland CreditAttribution: gmclelland commentedClosing as a duplicate of #2155931: Media Wysiwyg View Mode Preview Image doesn't remember the View Mode of the embedded media which is now marked as fixed. Please reopen if it is still an issue.
Comment #5
David_Rothstein CreditAttribution: David_Rothstein commentedThat 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.
Comment #6
ksiebel CreditAttribution: ksiebel commentedI have fixed this issue by setting the variable.
For example:
drush vset media_wysiwyg_wysiwyg_default_view_mode "wysiwyg"
Comment #7
Dave ReidI believe this is resolved with #2158177: Confusing UI for WYSIWYG view modes now.