summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJody Hamilton2012-07-18 20:46:00 (GMT)
committerJody Hamilton2012-07-18 20:46:00 (GMT)
commita2b6e31de4cd002d6fc5a840b36541864cc24333 (patch)
treeaee6dd2295d4765a9818b17236ec35ed97e2ed25
parent3e52690887b8e82141969296bffe352308216773 (diff)
fix bug occurring on single page webform with only fieldsets as native webform components
-rw-r--r--webform_entity.module4
1 files changed, 3 insertions, 1 deletions
diff --git a/webform_entity.module b/webform_entity.module
index f3fcc7b..12ee197 100644
--- a/webform_entity.module
+++ b/webform_entity.module
@@ -566,6 +566,7 @@ function webform_entity_webform_submission_submit(&$form, &$form_state) {
}
else {
$form_state['webform_entity']['submission'] = $submission;
+ _webform_entity_fieldset_storage($form, $form_state, $form_state['webform_entity']['submission']->submitted);
}
drupal_static('webform_entity_webform_submitted_object', $form_state['webform_entity']['submission']);
if (count($form_state['values']['submitted'])) {
@@ -606,6 +607,7 @@ function _webform_entity_fieldset_storage($form, &$form_state, $submitted) {
// Remove empty values.
$field = field_info_field($name);
$form_state['webform_entity']['submission']->{$name}[LANGUAGE_NONE] = _field_filter_items($field, $form_state['webform_entity']['submission']->{$name}[LANGUAGE_NONE]);
+ unset($form_state['values']['submitted'][$component['form_key']][$name]);
}
else {
_webform_entity_fieldset_storage($form, $form_state, $submitted[$key]);
@@ -701,7 +703,7 @@ function webform_entity_node_load($nodes, $types) {
}
// Don't add empty component if there are is a real component on the page.
foreach ($nodes[$node->nid]->webform['components'] as $component) {
- if ($component['type'] != 'pagebreak' && isset($component['page_num']) && in_array($component['page_num'], $page_nums)) {
+ if ($component['type'] != 'pagebreak' && $component['type'] != 'fieldset' && isset($component['page_num']) && in_array($component['page_num'], $page_nums)) {
foreach ($page_nums as $key => $page_num) {
if ($page_num == $component['page_num']) {
unset($page_nums[$key]);