Closed (fixed)
Project:
D7 Media
Version:
7.x-2.x-dev
Component:
Media WYSIWYG View Mode
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Dec 2013 at 07:21 UTC
Updated:
26 Nov 2016 at 14:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ndewhurstI noticed the same thing on one of our sites, and wrote this patch. It now also checks the GET request for a format, which is where media_wysiwyg_format_form gets it (see media/modules/media_wysiwyg/includes/media_wysiwyg.pages.inc). If no valid format is found, it falls back to the global default.
As an aside, I thought of changing "media_wysiwyg_view_mode_form_alter" to "media_wysiwyg_view_mode_form_media_wysiwyg_format_form_alter," since it only alters that one form presently, but I didn't want to step outside the scope of this issue.
Comment #2
bneil commentedI tested the patch and it works as expected. In the test case above, the image is rendered as the correct "preview" view mode when reselecting the image and clicking the media button.
Comment #3
aaron commentedCommitted to http://drupalcode.org/project/media.git/commit/7fdafec.
Comment #5
ndewhurstUnfortunately, this code seems to have been lost in a subsequent update. As far as I can tell, this is what happened:
1e037401dc7ca2cfcfbe4948e97b25c9f61d409b, which removed this code.media_wysiwyg_view_mode_form_alter()tomedia_wysiwyg_view_mode_form_media_wysiwyg_format_form_alter()(sweet!) and revised the code therein.$form['#formats']rather than recreating a file usingfile_view_file()).I'm guessing this was an unintended side effect, but can't say for sure just by looking from the outside. Hopefully someone can clarify, and if it was unintentional, restore this functionality.
The attached patch is very similar to the one I wrote above, but applies to the current 7.x-2.x code. It's working very well for me in my initial usage/testing.
Comment #6
emptyvoid commentedThe provided patch didn't diff correctly.
I've rerolled the patch against the current dev release.
Comment #8
joseph.olstadComment #9
joseph.olstadpatch #5 is the good one..
Comment #11
joseph.olstad