Commit de434a7c authored by Dan Chadwick's avatar Dan Chadwick
Browse files

Issue #2417757 by DanChadwick: PHP max_input_var check extended to component page.

parent bdb8cfda
Loading
Loading
Loading
Loading
+5 −0
Changes for includes/webform.components.inc: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -144,6 +144,10 @@ function webform_components_form($form, $form_state, $node) {
    '#value' => t('Save'),
    '#access' => count($node->webform['components']) > 0,
  );
  $form['warning'] = array(
    '#weight' => -1,
  );
  webform_input_vars_check($form, $form_state, 'warning');

  return $form;
}
@@ -277,6 +281,7 @@ function _webform_components_form_rows($node, $cid, $component, $level, &$form,
 */
function theme_webform_components_form($variables) {
  $output = '';
  $output .= drupal_render_children($variables['form']['warning']);
  $output .= theme('table', array('header' => $variables['header'], 'rows' => $variables['rows'], 'attributes' => array('id' => 'webform-components')));
  $output .= drupal_render_children($variables['form']);
  return $output;
+8 −2
Changes for webform.module: 8 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -4847,7 +4847,7 @@ function webform_input_vars_check(&$form, $form_state, $parent_key = NULL) {
    $form['#pre_render'] = array('webform_pre_render_input_vars');
    $form['#input_var_waring_parent'] = $parent_key;
  }
  if (!empty($form_state['input']) && empty($form_state['input']['form_build_id'])) {
  if (!empty($form_state['input']) && empty($form_state['input']['op'])) {
    // A form was submitted with POST, but the form_build_id was missing. The most likely cause of this
    // is that the POST was truncated because PHP exceeded its max_input_vars limit.
    $subs = array(
@@ -4882,7 +4882,7 @@ function webform_pre_render_input_vars($element) {
        '@count' => $count,
        '@limit' => $limit,
      );
      $element[$element['#input_var_waring_parent']]['input_vars_warning'] = array(
      $warning = array(
        '#markup' => '<div class="messages warning">' .
                     (user_access('administer site configuration')
                        ? t('This form contains @count input elements. PHP max_input_vars is @limit and should be increased.', $subs)
@@ -4890,6 +4890,12 @@ function webform_pre_render_input_vars($element) {
                     . '</div>',
        '#weight' => -1,
      );
      if ($element['#input_var_waring_parent']) {
        $element[$element['#input_var_waring_parent']]['input_vars_warning'] = $warning;
      }
      else {
        $element['input_vars_warning'] = $warning;
      }
      watchdog('webform',
               'Page contains @count input elements but PHP max_input_vars is only @limit. Increase max_input_vars.',
               $subs,