Closed (duplicate)
Project:
Media: YouTube
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Dec 2012 at 15:01 UTC
Updated:
20 Apr 2015 at 13:58 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
msteurs commentedWell, having a better look at it, I think those settings are even not (yet) exportable, as they don't appear in the File Entity tab of the Feature Create page.
Thanks again, Maarten
Comment #2
joelcollinsdc commentedSame here. Strange though that they are visible from drush fc. Weird.
NEW view modes export perfectly. Teaser/preview/default don't. not sure if this is a file_entity issue or what. Since I can see the exportables via drush i'm guessing its how media_youtube has exported its defualts?
Comment #3
shaisamuel commentedThis is such an important & critical feature, in today's Drupal style development. I dont know what is the effort to add, if I had the knowledge I would be happy to help.
Comment #4
aaron commentedThis is a duplicate of #1858370: Exporting File Field Display (Manage File Display).
Comment #5
james.williamsThe file display settings can't be exported with Features because they are declared by media_youtube in a hook_file_default_displays() rather than just being written to the database. Only one module (features or otherwise) can declare a default display (or other features component), so Features doesn't allow another module to export them. The media: vimeo project has the same problem.
It's possible to implement hook_file_default_displays_alter() in your module's .module file to change the original default file display declaration to have the settings that you want, but this is more of an alternative approach to solving the problem than actually allowing the configuration to be exported normally into a feature.
Comment #6
mikgreen commentedHere is a patch that moves file display defaults to database.
After applying this, the settings are exportable with features.
Inspired by how media module does it: https://drupal.org/node/1702700
Comment #7
mikgreen commentedReopening
Comment #8
mikgreen commentedComment #9
recrit commentedUpdates to the patch:
* Moved the import to a separate function.
* Added an update hook for existing installs.
Comment #10
marcelovaniMedia Youtube's hook_display_alter was conflicting with Features/Features Override.
I have applied this patch and all works fine.
Thanks.
Comment #11
andrewhine commentedI have also applied this patch and can confirm it resolves the issue.
Comment #12
mstef commentedPatch working for me. Thanks.
Comment #13
rossb89 commentedPatch in #9 confirmed working with previously exported to features - media youtube file display settings.
Comment #14
marcelovaniComment #15
aaron commentedCommitted to http://drupalcode.org/project/media_youtube.git/commit/a895e3a.
Comment #17
stefan.r commentedThanks for this patch! What would need to happen in order to get a new release out with this patch? (rc5?)
Comment #18
torotil commentedWhy not simply use hook_file_default_displays() in the first place?
The current approach basically overrides any display settings of features. This breaks install profiles.
Comment #19
joelcollinsdc commented@torotil, Check the commit, thats exactly what this commit does.
Comment #20
torotil commentedNo it doesn't. The linked commit pushes the file_display settings into the database in hook_install() and hook_update().
It does not use hook_file_default_displays(). And as stated above that breaks installation profiles.
Comment #21
saltednutHmm.. regarding #18 "this breaks install profiles' -- that requires more specific info to be clear... but I know your install profile architecture must not duplicate what your features architecture does. I assume that is what is breaking. Maybe I am off base here... But we have been using these patches for both File Entity, Media and Media Youtube for some time and the install profile works fine, but we leave it up to Features to manage the default settings for these file_display settings. So the fact that some defaults get set on hook_install doesn't really matter as we just immediately override it with the Feature later on during the installation. The way we manage this is by adding some changes to our install profile so that all the profile's Features get reverted as the final action of installation.
You can't really have Features try to persist configuration if you're using a hook that also persists this configuration. They will always be opposed.
Unless we change how hook_file_default_displays() works, it will always override the Feature.
Comment #22
torotil commentedNo, that's what module weights are for. Your feature simply needs to have a higher weight than media_youtube then it should be fine.
Exactly. You're adding an extra feature_revert in the installation profile because the feature itself is broken due to the way this issue was resolved.
Comment #24
dgtlmoon commentedThis seemed to work for me in current 2.x-dev, I could export the various display modes and they were reverted correctly, is that all there is to it?
Comment #25
jp.stacey commentedThis issue is I think a subset of the more general issue #2104193: Default file entities are not exportable by features (Media File Entity Overridden). As that issue's further on, I think this one should be marked as a duplicate but I can't be 100% sure. Anyone stumbling across this should at least consider both issues!
Comment #26
basvredeling@jp.stacey I think you're right. A generic solution would be preferable. Thanks for the crosstag. I'm being forward here and closing this in favor of #2104193: Default file entities are not exportable by features (Media File Entity Overridden).