I took a look but it was above me, but here is the error i am getting

Notice: Undefined index: 9 in webform_conditional_prepare_javascript() (line 834 of /var/www/html/production/aeesolar.com/sites/all/modules/webform/includes/webform.conditionals.inc).

the code block its referring to is: (line 832 - 842)

<?php
 // Add on the list of rules to the conditional group.
    foreach ($conditional['rules'] as $rule) {
      if ($rule['source_type'] == 'component') {
        $source_component = $node->webform['components'][$rule['source']];
        $source_parents = webform_component_parent_keys($node, $source_component);
        $source_id = 'webform-component-' . str_replace('_', '-', implode('--', $source_parents));

        // If this source has a value set, add that as a setting.
        if (isset($submission_data[$source_component['cid']])) {
          $source_value = $submission_data[$source_component['cid']];
          $settings['values'][$source_id] = is_array($source_value) ? $source_value : array($source_value);
        }
?>
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Title: Notice: Undefined index: » Notice: "Undefined index" when removing components used in conditionals

Thanks, this probably happens when you have set up a conditional rule, but then delete the component that was the source of the condition. Webform should either delete conditionals that depend on a field, or we should build some kind of failsafe that skips rules that are missing source components.

quicksketch’s picture

Status: Active » Needs review
FileSize
3.72 KB

This patch should address the problem by properly cleaning up Webform's orphaned conditional rules. It requires running update.php to clean existing orphans, and will keep conditionals properly trimmed as components are deleted in the future.

quicksketch’s picture

Status: Needs review » Fixed

Committed to 7.x-4.x.

mheinke’s picture

patch loads clean,
looks like its working :)

thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

adjusted request