Closed (fixed)
Project:
Media: YouTube
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
24 Oct 2011 at 23:08 UTC
Updated:
4 Jan 2014 at 01:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
nedjoParallel issue on media_vimeo: #1320310: Add display settings for "full" file view mode for media_vimeo.
Comment #2
RobW commentedAdding tags. Media: Youtube should align with the future of Media and File Entity before we roll a stable release.
We should add a teaser view mode with defaults too, in anticipation of #1051090: Revamp file view modes: migrate media_small to teaser, media_large to full, media_preview to preview; deprecate link & original.
Comment #3
RobW commentedWorked on this a bit tonight. There are a lot of moving parts here:
#1291428: Add a 'full' view mode and use it for file/%file pages, which adds the
fullview mode to file entity.#1296268: Add Preview and Teaser view modes, which adds
previewandteaserview mode to file entity.#1051090: Revamp file view modes: migrate media_small to teaser, media_large to full, media_preview to preview; deprecate link & original, which migrates old media view modes and settings to the new file entity view modes.
Here's the original issue adding the CTools exportables format to Media: #1141082: Provide a UI for identifying and reverting CTools Exportables overrides of file display configurations. Probably some good clues in there.
The patch attached does the obvious, which is to change the view mode names in
media_youtube_file_default_displays(). The defaults do not populate the view modes in Manage file display. I tried a couple different versions of Media and File entity, and found that default formatters set here wouldn't show up on custom view modes, only on the originalmedia_XXXview modes (which are removed by the above patches).There's not much (any) documentation for
hook_file_default_displaysbeyond other implementations of it which makes this harder to debug. CTools and file entity specialists feel free to chime in.Comment #4
RobW commentedConsider the post above thinking out loud. I think the problems may have been on my end. Half way to fixing now.
Comment #5
RobW commentedEver debug step by step to arrive basically where you started, but things are magically working now? Yeah.
This patch adds defaults for the new view modes and keeps the old ones. There's no downside to defining defaults if the view mode doesn't exist, so I don't think there's any reason to remove support for older versions of Media 2.x.
Comment #6
RobW commentedCommitted: http://drupalcode.org/project/media_youtube.git/commit/9e9763c.
Comment #7
RobW commentedMaybe we should use the "full" settings for "default", since that's what's available by... default on a clean Media install.
Comment #8
RobW commentedWhile Media defines a "full" view mode, it doesn't enable custom settings by default. Switched the "full" view mode formatters to "default" view mode so M:YT does something out of the box.
Commit: http://drupalcode.org/project/media_youtube.git/commit/2d4465a
Comment #9
RobW commented