Active
Project:
Contact form blocks
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Apr 2012 at 09:04 UTC
Updated:
13 Feb 2013 at 17:11 UTC
Module works fine with one category.
But if defined more categories, the form can not posted (Form submit error: "You must select a valid category"). The category value should still be set automatically? The form has also no drop down list.
Comments
Comment #1
pepelucai commentedI have the same issue.
In contact_form_blocks.module function contact_form_blocks_content line 102:
$form['cid'] = array('#type' => 'value', '#value' => $category);
This set the implicit category, but in the Implements hook_form_FORM_ID_alter() of contact_site_form() line 200:
function contact_form_blocks_form_contact_site_form_alter(&$form, &$form_state, $form_id) {
$form['#submit'][] = '_contact_form_blocks_submit';
}
If I debug with dpm form we have lost the property set un contact_form_blocks_content for cid and now form['cid']['#type'] has "select"value
If I force in this function $form['cid'] = array('#type' => 'value', '#value' => 6); (6=a valid category of my list of categories of contact form) the email is send.
But I don't know how get the category in this function
Comment #2
stevebird commentedI have changed this line into: $form['cid'] = array('#type' => 'hidden', '#value' => $category, '#name' => 'cid'); It's renders a hidden field into the form with category value and is works.
Comment #3
fuerst commentedJust a note: That problem probably is related to a proper fix of #1433234: General cleanup and fixes for 7.x
Comment #4
guy_schneerson commentedThis is the same issue as Mails always sent with default category for all blocks
and I have posted a patch solving this issue in another way, however if changing the type to hidden fixes the issue then it is a simpler fix.