Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The logic that a component which is hidden should be considered by conditional logic to have an empty value conflicts with components of the type 'hidden'. These components can be sent to the browser, used as a source for other conditionals and shown/hidden.
Because they are always initially hidden (by definition), they have an empty value for the purpose of other conditionals in the browser. The server does not have this issue because it doesn't look at the actual visibility of the components.
Comment | File | Size | Author |
---|---|---|---|
#2 | webform-hidden_components-2456079-1.patch | 1.93 KB | DanChadwick |
Comments
Comment #2
DanChadwick CreditAttribution: DanChadwick commentedThis patch changes the logic for components of type 'hidden' only to reflect whether it has been hidden/shown by conditionals, rather than whether it is actually visible.
This causes two desirable effects:
Note that only hidden components of 'hidden type' = 'hidden element' and not of type 'secure' can be used in browser conditionals.
Also note that once a hidden element has been submitted to the server as hidden (not shown), it will forever have an empty value. Future versions of webform may have the ability to set values to change this behavior.
Committed to 7.x-4.x.
Comment #3
DanChadwick CreditAttribution: DanChadwick commentedNeeds port to D8. Apply after #1840776: Components with a value that are hidden by conditionals should be empty
Comment #4
fenstratCommitted and pushed to 8.x-4.x. Thanks!