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)) {
Comment | File | Size | Author |
---|---|---|---|
#1 | 1060772-form-form-alter.patch | 665 bytes | agentrickard |
view_export.txt | 5.89 KB | DeweyOxberger |
Comments
Comment #1
agentrickardActually, checking for isset($form['vid']['#value']) is enough here.
Comment #2
larowlan#1: 1060772-form-form-alter.patch queued for re-testing.
Comment #3
larowlanTagging
Comment #4
larowlanLooks good
Comment #5
catchI 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.
Comment #6
webchickCommitted and pushed to 7.x. Thanks!