Closed (fixed)
Project:
D7 Media
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
3 Feb 2011 at 02:56 UTC
Updated:
10 Mar 2011 at 11:11 UTC
Jump to comment: Most recent file
In media.variables.inc, the variable dialoga_get_theme_name is assigned the property 'seven', referring to the Seven administration theme.
'dialog_get_theme_name' => 'seven',
This variable assignment unnecessarily associates this contributed module with a specific theme. This variable variable should be genericized.
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | 1049446_admin_theme_fallback.patch | 3 KB | JacobSingh |
| #13 | 1049446_admin_theme_fallback.patch | 2.64 KB | JacobSingh |
| #8 | 1049446_media_settings.patch | 4.59 KB | JacobSingh |
| #2 | media.variables.inc_.patch | 692 bytes | jessebeach |
| #1 | media.variables.inc_.1.patch | 692 bytes | jessebeach |
Comments
Comment #1
jessebeach commentedThis patch changes this set variable
'dialog_get_theme_name' => 'seven',
to
'dialog_get_theme_name' => variable_get('admin_theme'),
removing the modules dependency on the Seven theme.
Comment #2
jessebeach commentedComment #3
JacobSingh commentedShould a variable be getting a variable? I guess so, because there are cases where the admin theme will not work w/ Media due to the tight spacing constraints. I suppose this is okay, but can I get a +1 from someone else?
Comment #4
David_Rothstein commentedI was wondering something similar as Jacob. In theory this patch makes sense, but not all sites will even be using an admin theme, in which case I think this will wind up using their default theme instead. I'm trying to imagine (for example) what a theme like Garland would look like inside the media dialog. It's probably worth taking a look to see what kind of disaster it is :)
Granted, many themes (including Garland) look pretty bad inside the Overlay also, and this is a similar situation. However, in those cases you might just choose not to use the Overlay module. Choosing not to use the media browser seems like a bigger sacrifice to me.
Comment #5
aaron commentedI have the same hesitation as @David_Rothstein. I don't think that in the vast majority of cases it should be a problem to hard-code it with Seven as the default, because AFAIK, it should be okay to use that theme even if it isn't enabled (can someone test that to make sure)? Thus, the only case I can think of where it might be a problem would be if someone has entirely removed the Seven theme from their file system. In which case they can also override the variable...
Comment #6
james.elliott commentedI think a better solution than setting the variable to a variable would be to add a configuration option to alter the setting from the UI.
Comment #7
JacobSingh commented+1 to a dropdown to select the theme in media settings.
Comment #8
JacobSingh commentedI'm renaming this because this patch does more than was specified.
I started with the original goal, but then we've got other bugs about not being able to change the allowed extensions without settings.php tomfoolery, and the form looked quite barren with only one field.
The descriptions are... wordy. But it's hard to explain wtf this stuff is. Please feel free to edit them and re-post patches.
Comment #9
james.elliott commentedR to the TBC
Comment #10
JacobSingh commentedCommitted.
Comment #11
David_Rothstein commentednot sure what this means - maybe "the" isn't supposed to be there?
Comment #12
JacobSingh commentedFixed
Comment #13
JacobSingh commentedHere's an update which defaults to the admin theme when not specified.
Comment #14
JacobSingh commentedslight update to the submit hand;er.
Comment #15
JacobSingh commentedCommitted it w/o review.