Hi,
I get this warning:
Warning: Invalid argument supplied for foreach() w forum_menu_local_tasks_alter() (linia 179 z /home/esperant/domains/esperanto.pl/public_html/d7/modules/forum/forum.module).

I don't see bad thing because of this warning. How switch off it?

Comments

Luna Vulpo’s picture

Any idea?

barbarae’s picture

I am getting exactly the same problem on May 30 2011

droplet’s picture

Title: On top the forum is warning » Invalid argument supplied for foreach() in forum_menu_local_tasks_alter()
Component: forms system » forum.module
Status: Active » Postponed (maintainer needs more info)

needs more info to reproduce this bug and please do test with -dev version.

Luna Vulpo’s picture

In my instalation problem stops after upgrading to 7.2.

tanvirahmad’s picture

Same issue....:(

michee.lengronne’s picture

The same for me. But with Drupal 7.12.

neRok’s picture

Title: Invalid argument supplied for foreach() in forum_menu_local_tasks_alter() » forum_menu_local_tasks_alter() presumes that at least 1 node type has taxonomy_forums field.
Version: 7.0 » 7.x-dev
Status: Postponed (maintainer needs more info) » Active

I found the problem using 7.22. It is now line 175, and here is that section from forum.module.

      // Loop through all bundles for forum taxonomy vocabulary field.
      $field = field_info_field('taxonomy_forums');
      foreach ($field['bundles']['node'] as $type) {

If you delete taxonomy_forums field from all node types, $field will be empty, and the foreach loop will fail. This just needs an if (isset($field['bundles']['node'])) check implemented.

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.