diff --git a/includes/webform.components.inc b/includes/webform.components.inc index 833aad1..9addf1c 100644 --- a/includes/webform.components.inc +++ b/includes/webform.components.inc @@ -483,22 +483,21 @@ function webform_component_edit_form($form, $form_state, $node, $component, $clo '#attributes' => array('class' => array('webform-position')), ); - if (!empty($node->webform['components'])) { - $options = array('0' => t('Root')); - foreach ($node->webform['components'] as $existing_cid => $value) { - if (webform_component_feature($value['type'], 'group') && (!isset($component['cid']) || $existing_cid != $component['cid'])) { - $options[$existing_cid] = $value['name']; - } + $options = array('0' => t('Root')); + foreach ($node->webform['components'] as $existing_cid => $value) { + if (webform_component_feature($value['type'], 'group') && (!isset($component['cid']) || $existing_cid != $component['cid'])) { + $options[$existing_cid] = $value['name']; } - $form['position']['pid'] = array( - '#type' => 'select', - '#title' => t('Parent'), - '#default_value' => $component['pid'], - '#description' => t('Optional. You may organize your form by placing this component inside another fieldset.'), - '#options' => $options, - '#weight' => 3, - ); } + $form['position']['pid'] = array( + '#type' => 'select', + '#title' => t('Parent'), + '#default_value' => $component['pid'], + '#description' => t('Optional. You may organize your form by placing this component inside another fieldset.'), + '#options' => $options, + '#access' => count($options) > 1, + '#weight' => 3, + ); $form['position']['weight'] = array( '#type' => 'textfield', '#size' => 4,