Here is the error:

Notice: Undefined index: #value in forum_form_alter() (line 589 of /home/quickstart/websites/example.dev/modules/forum/forum.module).

It seems when I create a view using Views UI that has an exposed filter and is letting me view taxonomy vocabularies (with the forum vocabulary) I get the error.

The code in forum.module has:

function forum_form_alter(&$form, $form_state, $form_id) {
  ...
  if (isset($form['vid']) && ($form['vid']['#value'] == $vid)) {
    ...

For my view's form the vid is defined but has no #value sub key. I'm guessing the forum.module didn't take into account the possibility of other forum taxonomy forms passing through hook_form_alter.

To get to that error using Quickstart 0.9 VM:

Drush a D7 clean install with ctools and views. Enable Views UI. Enable forums.

Add two vocabularies; "Assignee" and "Status", each with several terms.
Add a forum container and move the default forum into it.

Import the view. Put the block on a page and whenever you go to that page you get the error.

This code seems to fix it but could easily whack somebody else - this would need somebody smart then me to look it over:

Change that if to be this:

  if (isset($form['vid']) && isset($form['vid']['#value']) && ($form['vid']['#value'] == $vid)) {
Files: 
CommentFileSizeAuthor
#1 1060772-form-form-alter.patch665 bytesagentrickard
PASSED: [[SimpleTest]]: [MySQL] 32,906 pass(es). View
view_export.txt5.89 KBDeweyOxberger

Comments

agentrickard’s picture

Version: 7.0 » 8.x-dev
Status: Active » Needs review
Issue tags: +Novice
FileSize
665 bytes
PASSED: [[SimpleTest]]: [MySQL] 32,906 pass(es). View

Actually, checking for isset($form['vid']['#value']) is enough here.

larowlan’s picture

#1: 1060772-form-form-alter.patch queued for re-testing.

larowlan’s picture

Issue tags: +needs backport to D7

Tagging

larowlan’s picture

Status: Needs review » Reviewed & tested by the community

Looks good

catch’s picture

Version: 8.x-dev » 7.x-dev

I nearly asked for tests but the patch is trivial and creating the test would be quite a lot to add. Committed to 8.x, moving back to 7.x for webchick.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 7.x. Thanks!

Status: Fixed » Closed (fixed)
Issue tags: -Novice, -needs backport to D7

Automatically closed -- issue fixed for 2 weeks with no activity.