Needs review
Project:
Contact form blocks
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Jul 2012 at 16:41 UTC
Updated:
1 Aug 2014 at 19:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ronny89 commentedthe same happens on my installation.
i know it worked once, but at some point the described behaviour arised. unfortuantely i can't determine that point in time. but i'm quiet sure it wasn't the latest update.
@spacebox, have you yet tried to disable any other modules to see if something is interfering?
Comment #2
guy_schneerson commentedI am getting the same issue the looks like the problem is in replacing the 'select' field of the contact form with a 'value' element. The value of cid just dosen't make it to the form submit.
I have fixed this by using another approach insted of replacing the 'cid' form element I hide it using 'style' = 'display: none;'
This is not elegant as I need to hide the title and the required flag (safe to do because we are setting the value in code) but it works.
Another approach may be to hide the element in a hook_form_alter()
will post a patch of my code in a bit
Comment #3
guy_schneerson commentedPatch for above
Comment #4
guy_schneerson commentedForm submit error: "You must select a valid category" is the same issue and comment #3 proposed a simpler solution that needs testing.
Comment #5
lnfra commentedWhy use a select when you can use a hidden?
I just replace the line 102 of contact_form_blocks.module which originally is like
$form['cid'] = array('#type' => 'value', '#value' => $category);The problem here is that the type of the form element is added as "value" and that is not a valid HTML form element. It doesn't get added to the form by drupal_render($form).
In order to correct the bug I just replaced that line with a prober hidden type element with the category value:
$form['cid'] = array('#type' => 'hidden', '#name' => 'cid', '#value' => $category);And it works correctly!