diff --git a/webform.module b/webform.module index 2fffd0c..5cc3e7e 100644 --- a/webform.module +++ b/webform.module @@ -1890,10 +1890,11 @@ function webform_client_form($form, &$form_state, $node, $submission, $is_draft $page_count = $form_state['webform']['page_count']; $page_num = $form_state['webform']['page_num']; - // Recursively add components to the form. + // Recursively add components to the form. The unfiltered version of the + // form (typically used in Form Builder), includes all components. foreach ($component_tree['children'] as $cid => $component) { $component_value = isset($form_state['values']['submitted'][$cid]) ? $form_state['values']['submitted'][$cid] : NULL; - if (_webform_client_form_rule_check($node, $component, $page_num, $form_state)) { + if ($filter == FALSE || _webform_client_form_rule_check($node, $component, $page_num, $form_state)) { _webform_client_form_add_component($node, $component, $component_value, $form['submitted'], $form, $form_state, $submission, 'form', $page_num, $filter); } } @@ -2119,7 +2120,9 @@ function _webform_client_form_add_component($node, $component, $component_value, $parent_fieldset[$component['form_key']] = $display_element; } } - elseif ($component['page_num'] == $page_num) { + // Show the component only on its form page, or if building an unfiltered + // version of the form (such as for Form Builder). + elseif ($component['page_num'] == $page_num || $filter == FALSE) { // Add this user-defined field to the form (with all the values that are always available). $data = isset($submission->data[$cid]['value']) ? $submission->data[$cid]['value'] : NULL; if ($element = webform_component_invoke($component['type'], 'render', $component, $data, $filter)) {