Hi,
I just installed features_override. My site has a feature (Features 1.0) which includes strongarmed variables (Strongarm 2.0).
I change one of these variables, Features and sees that my feature is overridden. However, when I go to "features-override/add", I'm told "No overridden components found.".
The variable that is overridden is a serialized array (if that matters).
Interestingly, I also warned that:
The following overridden view(s) are provided by other modules: company_news. To resolve this problem either revert each view or clone each view so that modified versions can be exported with your feature.
(company_news does not have any overridden components, and is also not the feature that contains the overridden variable - so not sure if it's related to the problem or not)
Really looking forward to trying this module. Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | in_array_not_strict-1081910-5.patch | 1.1 KB | ryan_courtnage |
| #2 | Screen shot 2011-03-08 at 2.51.39 PM.png | 58.03 KB | ryan_courtnage |
| Screen shot 2011-03-04 at 4.04.55 PM.png | 42.98 KB | ryan_courtnage | |
| Screen shot 2011-03-04 at 4.07.03 PM.png | 17.5 KB | ryan_courtnage |
Comments
Comment #1
nedjoThanks for the report. I tested this (in D7) and it seemed to work. Steps I took:
* Install Debut Article feature.
* Edit the node options for the Article content type, setting the default state to unpublished.
* Return to the Override overview page. The node_options_article variable appears for selection.
Pls install Diff, if you don't already have it, and then click the "Review overrides" tab for the feature you've overridden and paste here the diff.
Comment #2
ryan_courtnage commentedDiscovered something interesting while doing this. Some of my overrides are detected, but not the one involved in my original report.
Here's the current diff:
You'll see in the attached screenshot, that the overrides to preprocess_css and preprocess_js are detected. However, the third override is not detected.
As I mentioned, the difference is to a variable that is a serialized array (and it's a fairly big one too). It's the variable content_access.module uses to store it's per-content-type access settings. Below is what I currently have in the feature's .strongarm.inc file. I've commented where the diff occurs:
Comment #3
nedjoThanks for the extra info. Don't immediately know why this isn't showing up. I vaguely recall an edge case involving an array with a single key of zero. I'll try to dig it up if I get a chance.
Comment #4
ryan_courtnage commentedAfter tracing through the code, I did indeed find a problem that will occur with the first key of indexed arrays (0).
In features_override.module:198, there is the following:
When my strongarm variable export (which contains an indexed array) is processed, this condition will return TRUE for key 0.
Looking at php.net, you'll see several people warning about in_array() not using strict comparisons, and how this can cause problems with 0: http://ca3.php.net/in_array
Seeing how this condition is really only looking for specific strings in $key (contains 'content_has_extra_fields' or 'features_override_recursion_marker'), it might be reasonable to cast $key to a string:
This change fixes the problem with my override not being detected. There are probably other ways to skin the cat as well...
Ryan
Comment #5
ryan_courtnage commentedProblem duplicated with -dev branch. Patch attached.
Comment #6
nedjoNice catch, thanks! Will apply soon.
Comment #7
BarisW commentedIs this the same for the D7 version? I seems that my overridden variables are not being detected as well.
Comment #8
firflantTested with various variables on D7. Did not work. This module is not compatible with Strongarm on D7?
What i really did:
1. Created and enabled the first feature with variable set to "0".
2. Created and enabled the second feature overriding this variable to "2".
After this both of them are overriden and variable in fact has value "0". Diff curiously shows that the first feature has a value "2" overriden to "0"
and the second feature has "2" overriden to a blank line
3. If I revert the first feature now - variable will have the proper overrriden value "2" and everything will be shown as default, so as it should be without reverting the parent feature, which in some cases can be unwanted.
I hope it help to find out a solution.
Comment #9
mpotter commentedMoving this back to "Needs work" for the 7.x-2.x branch since there is no patch posted for that version yet.
Comment #10
ciss commentedComment #11
marttir commentedThanks @ciss, the #1 patch from that issue seems to fix problems with override detection / reverting features when Strongarm variables are overridden with Features Override.