Strongarm is weighted at -1000 to run before all other modules. Features_override uses hook_strongarm_alter() to override variables, but features_override_strongarm_alter() is not available during strongarm_init() as it is declared dynamically in features_override_init().
Setting features_override weight to -1001 allows features_override_strongarm_alter() to be declared before strongarm_init() is called.
We had an issue where attempting to override featurized strongarm variables would alter the rendered defaults, but would not alter the variables at runtime.
This probably isn't the ideal solution, but this is the only way we could get it to work on a stock D6 install.
Comments
Comment #1
nedjoIn 7.x we are no longer dynamically declaring the alter functions.
I also recently talked with a couple of devs at Phase2 and it seemed like they were mulling the possibility of having a universal features component alter hook, to avoid the need to declare a separate one for each component type.
I'd welcome a backport of the 7.x code to 6.x, but don't plan to do it myself.
Comment #2
scottrigbyhi nedjo: i looked in 7.x-1.x to see how i could help with a backport… but looks like it's still the same? features_override_init() still dynamically loads strongarm.features_override.inc. Or did you mean something else?
Comment #3
nedjoI originally wrote code to dynamically generate the alter functions and later replaced that with include files. I was mistakenly thinking I'd done this update only for D7, but I also did it for D6.
Moving this to D7 on the assumption it's going to be an issue there too and so shd be fixed first in D7.
I'm thinking for D7 the answer is to use the registry by adding the alter hook include files to the .info file's files array, rather than manually including them in hook_init(). Then they'll be loaded when they're needed. If for some reason that doesn't work, we could look at messing with hook ordering in hook_module_implements_alter().
With that in place, I'd be okay with a D6 approach that messed with the module's weight.
Comment #4
nedjoHmm, the registry won't in itself help. We could consider using hook_hook_info_alter().
Comment #5
scottrigbyok, committed the weight change to 6.x-1.x, changing title to describe the problem instead of the D6 solution – and leaving status the same until 7.x is solved in a different way
Comment #6
nedjok, thanks for the fix. Ideally though we should have fixed this in D7 before D6. Let's try to get a hook_module_implements_alter() fix in.
Comment #7
brad.bulger commentedi don't know what the state of this is, but there is no hook_strongarm_alter() in the 7.x version of Strongarm and Features Override is still trying to use it for "features_override_items" entries. Are those obsolete? They're still reported as potential overrides.
Are variable overrides supposed to be working in Features Override 7.x?
Comment #8
ciss commentedhook_strongarm_alter() is a generic hook_COMPONENT_alter() hook that is invoked e.g. in features_get_default().
Comment #9
ciss commentedWe've noticed that reverting the overrides will not work, as hook_strongarm_alter() does not get invoked for the overridden variable components.
Instead one has to revert the overridden feature.