Summary

Webform uses Drupal.settings.webform.conditionals to declare all same-page conditionals that need to be executed. When using AJAX forms (using webform_ajax) then these settings accumulate across pages because Drupal.ajax.commands.settings() uses jQuery.extend to merge them with the existing settings. This means rules for previous pages are executed on non-existing elements.

The conditional operators in webform.js deal silently with non-existing elements so this issue only concerns custom operators.
tings

Proposed solution

Store the page_num with all ruleGroups in Drupal.settings.webform.conditionals.ruleGroups and only execute rules for the current page.

Comments

torotil created an issue. See original summary.

torotil’s picture

Issue summary: View changes
torotil’s picture

Status: Active » Needs review
StatusFileSize
new2.07 KB

Here is a patch that implements the proposed solution.

Status: Needs review » Needs work

The last submitted patch, 3: 3005684-conditionals-ajax-3.patch, failed testing. View results

torotil’s picture

Status: Needs work » Needs review
StatusFileSize
new1.13 KB

The patch included some debug code. Sorry.

liam morland’s picture

Status: Needs review » Closed (outdated)

Drupal 7 is no longer supported. If this applies to a supported version, please re-open.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.