These warning messages appear in _features_override_set_additions() and _features_override_set_deletions().
The foreach in both these functions is being passed (possibly due to improper creation of feature overrides?) single strings, single ints, classes (which is ok), arrays, and arrays that qualify as isset() but would fail on !empty().
The single strings (of value '0', string length 1), single ints, and arrays that are empty() are all throwing warnings when foreach tries to process them.
Are all data types acceptable parameters for argument 1 of _features_override_set_additions()? Knowing what the expected data types are for this parameter will help me save some time while troubleshooting this on my end.
Comment | File | Size | Author |
---|---|---|---|
#23 | invalid_argument_supplied-1648078-23-D6.patch | 8.25 KB | BarisW |
#10 | invalid_argument_supplied-1648078-10.patch | 6.61 KB | marcelovani |
#8 | features_override-scalars-1648078.patch | 1.83 KB | smk-ka |
Comments
Comment #1
mrfelton CreditAttribution: mrfelton commentedSame issue for me here.
Comment #2
kclarkson CreditAttribution: kclarkson commentedI got this as well Undefined index: additions in features_overrides_features_export_options() (line 38 of
Comment #3
Letharion CreditAttribution: Letharion commented@kclarkson, that's a different issue.
Comment #4
Letharion CreditAttribution: Letharion commentedSeemingly stemming from the same problem, not validating the inputs, can also yield
Warning: array_keys() expects parameter 1 to be array, null given in features_override_module_component_overrides()
from the codeif (!array_key_exists($key, $normal)) {
, at line 318 at the time of writing.Comment #5
mpotter CreditAttribution: mpotter commentedI believe this is fixed in the latest -dev release. I think only arrays are supposed to be passed, but I'll need to double-check. Please feel free to reopen this if the original issue isn't fixed.
If you are having a different error or in a different code location, please create a new issue.
Comment #7
vinmassaro CreditAttribution: vinmassaro commentedUsing 7.x-2.x-dev, I am running into the same issue when exporting an image style override for the 'thumbnail' image style that comes with the standard Drupal 7 install. It does not activate the overridden style (Scale and Crop instead of Scale) but does have my updated dimensions. It also continues to display the 'Override defaults' submit button. On features module pages, I get these errors:
Comment #8
smk-ka CreditAttribution: smk-ka commentedSome components do not export arrays or objects, but simple strings, which the _features_override_set_*() functions try to iterate over. This patch simplifies those functions by bailing quickly if encountering a scalar variable, while afterwards only needing to differentiate between objects and arrays.
Comment #9
aschiwi CreditAttribution: aschiwi commentedThank you smk-ka. I just applied your patch from #8 and the errors went away. Couldn't see any other/new problems.
Comment #10
marcelovaniI fixed this problem with a different approach then #8
I am checking the type of the variables instead.
Comment #11
Andrew Edwards CreditAttribution: Andrew Edwards commented@vinmassaro I've created a similar issue here with a hacky work around #1834342: Cannot override default image styles. I think it's similar to yours ... although I got a different error message.
Comment #12
vinmassaro CreditAttribution: vinmassaro commented@Andrew Edwards thanks for the heads up. I ended up just exporting an additional image style in my feature instead of using Features Override to change the default thumbnail.
Comment #13
Angry Dan CreditAttribution: Angry Dan commentedis_scalar is no good at finding NULLs. I think a better approach is something like this: http://stackoverflow.com/questions/3584700/iterable-objects-and-array-ty... to explicitly check if you can loop over the elements.
Will post a patch if I get more time
Comment #14
jeremylichtman CreditAttribution: jeremylichtman commentedI'm finding many places in features_overrides where it is assuming that every feature encountered will have overrides (obviously not the case).
I put in is_array checks in a few places in my local install:
features_override_features.inc - three places in features_overrides_features_export_options()
features_override_export.inc - in features_override_export_keys()
Those two seem to get rid of the error messages I was experiencing. They're obviously just stop-gap measures, as I haven't dug in enough to get a feel for the architecture or coding style of this module.
Comment #15
SocialNicheGuru CreditAttribution: SocialNicheGuru commented#14 can you create a patch that can be tested?
Comment #16
marcelovani@SocialNicheGuru, @jeremylichtman I have posted the patch that does exactly this on #10, which I am using. Can anyone else test to eventually get this committed?
Comment #17
marcelovaniComment #18
marcelovaniComment #19
afoster CreditAttribution: afoster commentedI've applied the patch in #10 to the latest dev. It's fixed the errors. Thank you.
Comment #20
marcelovaniComment #21
BarisW CreditAttribution: BarisW commentedCan this be ported to D6 too? I'm having the same issues here (using Drupal Commons).
Comment #22
BarisW CreditAttribution: BarisW commentedAh apologies, I was too quick. This doesn't seem to be committed to de 7.x branch yet. Let's await that first.
Comment #23
BarisW CreditAttribution: BarisW commentedHere's the D6 port of the same patch in #10. Fixes the issues for me.
Comment #24
mpotter CreditAttribution: mpotter commentedCommitted to ed1df0e.
Comment #25
BarisW CreditAttribution: BarisW commentedThanks, now also D6?
Comment #26
ZeiP CreditAttribution: ZeiP at Citrus Solutions Oy commentedDrupal 6 is no longer supported.