Closed (won't fix)
Project:
Features
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Jan 2010 at 23:23 UTC
Updated:
23 Aug 2012 at 21:24 UTC
(Fair warning: This may belong in the Features issue queue.)
When using Strongarm in conjunction with Features, a handful of variables are marked "overridden" immediately after the feature is enabled. I think the problem is the result of Strongarm setting defaults before their corresponding modules were enabled.
I've attached a screenshot that shows some of the variables that are immediately overridden. In this example, all of the listed variables are being set by a feature that also enables several modules.
node_options_page: A core variable. The feature that sets this also enables the Revision module, which adds the node option "Create a new revision." Adding this "node option" may may alter the default Strongarm set earlier.date_default_timezone: Another core variable. This one is probably being touched when the Date API module is enabled by the same feature.Perhaps this can be solved by ensuring that Strongarm defaults are enforced after all modules in a feature are enabled?
| Comment | File | Size | Author |
|---|---|---|---|
| strongarm-defaults-overridden-automatically.png | 49.07 KB | todd nienkerk |
Comments
Comment #1
todd nienkerk commentedI'd like to amend the Pathauto section above:
pathauto_update_action: This is likely changed when the Path Redirect module is enabled, as it adds a new update action to Pathauto.pathauto_node_pattern: I don't know what other module could be touching this. Nothing comes to mind.Comment #2
wik commentedsame here...
Comment #3
tirdadc commentedI'm having this issue with some exported variables that are settings for the Embedded Image Field module, namely to determine which providers are available by default.
Comment #4
Oscar Illada commentedsame issue!!! but with others variables.
Comment #5
cknoebel commentedMe, too. IMCE for me.
Comment #6
mstef commented+1..I made the same assumption for cause.
Comment #7
yhahn commentedYes, this is a fairly common issue where a feature strongarms a variable or other component and then the install script of another module overrides it right away.
I think one way to address this would be to revert all components of a feature when it is enabled but it's not a particularly appealing option to me as there is no way to hook into a feature's install/enable event without writing a specific
hook_install()orhook_enable()implementation for the Feature. In addition, this could be considered rather rude -- you could blow away some overrides that someone has in their DB by "accident" -- ie. they are just turning off and back on a feature to debug another problem, change their mind, etc.I'll keep thinking about options here, but generally speaking I'm of the opinion that other modules, especially API/library type modules, should not be running
variable_set()against their own variables in install/enable hooks.Comment #8
that0n3guy commentedsub....
Comment #9
mstef commentedWhen I come across this situation, I add an .install file, load the features file which contains the strongarm declarations, and explicitly set the variable. I suppose you could also delete the variable and let strongarm do what it does.
Would be nice if there was a more clean solution.
Comment #10
yhahn commentedPatch the offending module. : P jk
Comment #11
mstef commentedVery good point
Comment #12
grzegorz.bartman commentedsubscribing
Comment #13
timwoodSub
Comment #14
cleanthes commentedsubscribing
Comment #15
nwe_44 commentedsubscribing.
Comment #16
Grayside commentedAs a purely UI fix, it would be interesting if you could find out what variables are already set when installing a module with hook_strongarm(). Perhaps something like
drush strongarm-overridden <module-name>and something called automatically on install?Comment #17
lee20 commentedsubscribing
Comment #18
jide commentedSub.
Comment #19
alfthecat commentedsubscribing
Comment #20
dubois commentedI'm also having this issue with IMCE (6.x-2.0-rc2) specifically with IMCE profiles.
Comment #21
alfthecat commentedcan confirm IMCE on my side too. As well as Pathauto patterns.
Comment #22
jgraham commentedOpened an issue for pathauto to see if the maintainer is open to patching pathauto to avoid setting variables during install.
http://drupal.org/node/1026376
Comment #23
boobaaOkay, this still applies to 7.x.
Comment #24
boobaaI have found a way to get around this and I have documented it in my blog at KYbest.
Basically it looks like that Strongarm (and/or others) has some issues with some features in
hook_install()or something; to be honest I dodn't have the time to dig deeper into it since I have found a way to get around it.Comment #25
gantenx commentedsubscribing
Comment #26
RobW commentedHaving the same issues with the variables posted in the issue description.
Is there a reason that a feature doesn't enable its dependencies in a separate step before enabling itself? It seems like that would be a simple fix (and is basically what #24 outlines in their blog post), but maybe someone more knowledgeable of the inner workings of Features can tell me if this would be a bad idea.
Comment #27
hefox commentedFeatures are modules, they need to be enabable/disable-able like regular modules via things like drush; drupal/etc. are the ones controlling that workflow.
Comment #28
Taxoman commentedComment #29
mpotter commented