Closed (duplicate)
Project:
D7 Media
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 May 2013 at 23:37 UTC
Updated:
7 May 2014 at 05:41 UTC
Jump to comment: Most recent, Most recent file


Comments
Comment #1
aaron commentedI am aware of this issue, coming from #835516: Add ability to edit file meta data and fields when embedded in WYSIWYG. I will work on them simultaneously.
Comment #2
aaron commentedBecause the fix is a bit complicated, I have included it at #835516: Add ability to edit file meta data and fields when embedded in WYSIWYG and I'm closing this issue as duplicate.
Comment #3
drupal_was_my_past commentedThe current 7.x-2.x-dev branch that includes the media_wysiwyg_view_mode module has reintroduced this bug in commit 7d6a333. Here is a patch that fixes it. It looks like intention in #1792738-72: Allow custom file view modes for WYSIWYG display is to merge the media_wysiwyg_view_mode module back into the media module itself, in which case this patch would be irrelevant.
Comment #5
kreynen commentedNot sure why this patch didn't apply in testing... or why when I recreated it my version has a/b before the files, but resubmitting it w/ a/b to see if testing will apply. I tested this with media_youtube and it worked. Did not work with media_vimeo. Added issue in that queue.
#2060449: When editing a file in the WYSIWYG, the "Display as" view mode selection does not inherit the default value
Comment #6
kreynen commentedComment #7
kreynen commentedresubmitting for testing
Comment #8
bneil commentedFrom my testing, the "Display as" defaults do work as expected now with the latest version of media. I'm not using the included media_wysiwyg_view_mode module that's now in media. rocket_nova, kreynen, is that the issue for you?
Since media_wysiwyg_view_mode is going to get rolled into media, maybe this should just be postponed until that happens and see if this is still an issue.
Comment #9
mirzu commentedWith the media_wysiwyg_view_mode module enabled the patch works as expected. I also tested without the patch enabled, confirming that it does something. I remember this frustration and dance with joy that it's getting fixed.
Talked to DaveReid and Bneil and while the module is going to be rolled in the seperate module is going to stay for Alpha1.
/dance.
Comment #10
dave reidCommitted #7 to 7.x-2.x. Thanks everyone! http://drupalcode.org/project/media.git/commit/01be0a5
Comment #12
mpotter commentedHas this broken again in the latest -dev? With or without the media_wysiwyg_view_mode I am not able to get this working. It still always shows "Default" for the view mode when I edit an image.
Comment #13
mpotter commentedHere is a patch for the latest -dev version that seems to fix this regression issue. It was a simple oneline change to the javascript to pass along the current view_mode when the popup is first created. Not sure if there are any other side-effects of this change, but it seems to work well for us here.
Note that I am not using the media_wysiwyg_view_mode submodule. This is just for the normal media module. With this patch it shows the correct value in the dropdown instead of always resetting to "default" when editing a file in the wysiwyg.
I normally wouldn't reopen an older issue like this, but since this patch directly addresses the problem in the original post that seems to have broken somewhere down the line, it seems appropriate to keep this new patch with this older history. But I'm going to reopen the issue and mark as Needs Review to get the attention of the maintainer. Please let me know if there is a better way of fixing this.
Comment #14
mpotter commentedHmm, seems that the mediaStyleSelector is also used at the end of the process when uploading a new image. In that case overwriting the format field seems to cause a problem and prevents new images from being uploaded.
Still way out of my depth with understanding the complexities of this module, but this tweaked patch seems to fix the issue for editing existing images as well as still allowing new image uploads to work.
Comment #15
mpotter commentedHmm, one more try. The above patch still caused problems for inserting new images (when mediaFile.fields is not defined). This one seems to work now.
Comment #16
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 this is still an issue.
Comment #17
rooby commentedClosing as per #16.