Forum's vocabulary could be renamed and it's machine name could be also changed.
So we need to iterate through all the fields to find forum's field to populate local tasks for forum.

Steps to reproduce:
1) Visit admin/structure/taxonomy/forum/edit
2) Change vocabulary name to Forum or just change machine name to 'forum' from 'forums'
3) Save changes
4) Visit /forum

Warning: Invalid argument supplied for foreach() in forum_menu_local_tasks_alter() (line 181 of /var/www/d7/modules/forum/forum.module).
CommentFileSizeAuthor
#1 895774-forum-links-d7.patch2.26 KBandypost

Comments

andypost’s picture

StatusFileSize
new2.26 KB

I think that looping through all fields is not much expensive as loading vocabulary

andypost’s picture

aangel’s picture

This error still appears to be present in D7-1.0. Changing the taxonomy name as outlined above produces the error.

bfroehle’s picture

This is also addressed in #1003308: Forum module cannot decide if it wants 'taxonomy_forums' hardcoded in it leading to faulty functioning. I'm tempted to mark this as a duplicate, although the approach here is (radically) different.

bfroehle’s picture

Status: Needs review » Closed (duplicate)

I think this was fixed by #1003308: Forum module cannot decide if it wants 'taxonomy_forums' hardcoded in it leading to faulty functioning. Marking as duplicate, but reopen if this is still an issue.