Working on a site locally and was adding a feature and this Warning popped up. So far it doesn't seem to break anything but it shows up whether my features are enabled or not.

Warning: Invalid argument supplied for foreach() in features_admin_form() (line 332 of /Users/james/Sites/localhost/MYSITE/sites/all/modules/contrib/features/features.admin.inc).

Comments

febbraro’s picture

Status: Active » Postponed (maintainer needs more info)

I dont have this problem. Do you have any features that do not have any dependencies declared in their .info files?

jnettik’s picture

I've only used on feature on this site. It had dependencies but the error also shows without any other features enabled. Only the module.

febbraro’s picture

That main pages process any Feature in the system, enabled or not, b/c it shows Features there that can be enabled. So the error could be in one of the disabled features. Can you track down with one and debug it a little bit more?

jnettik’s picture

I only had one feature running and I removed it completely, still got the warning. I also checked to see if it was the features_tests feature that comes with the module. Without both of those the warning still appeared.

tomwrobel’s picture

Just as a quick follow-up. I was having this issue, and it turned out to be incorrectly declared dependencies in a non-features related module.

The function on line 332 looks for all dependencies in all modules, not just in features modules.

In the relevant module.info file, I had dependencies = X rather than dependencies[] = X.

gagarine’s picture

Status: Postponed (maintainer needs more info) » Active

Same than 5. Not sure it has to be fixed...

hefox’s picture

Title: features_admin_form() gives off warning » features_admin_form() gives off warning if dependencies are declared wrong in a module (Invalid argument supplied for foreach())

I'd be tempted to won't fix it

gagarine’s picture

Core do check if it's an array http://api.drupal.org/api/drupal/includes!module.inc/function/_module_build_dependencies/7 I think we should do the same to keep consistency.

For my point of view core should check than the .info is valid and give a nice warning if not when the module is activated. But that's a core feature request.

mpotter’s picture

Status: Active » Closed (won't fix)

Please reopen if this still occurs in the 7.x-rc2 release.