Bug description
As reported by @aerni here #6348 (comment), we found that revealer handling could be improved when multiple conditions are being evaluated.
How to reproduce
- Setup a blueprint with the following fields:
-
handle: button_typefield:
display: 'Button Type'type: selectoptions:
entry: nullasset: nullmultiple: false
-
handle: more_settingsfield:
display: 'More Settings'type: revealermode: toggle
-
handle: download_assetfield:
display: 'Download Asset'type: toggleif:
button_type: 'equals asset'more_settings: 'equals true'default: true
-
handle: entry_urlfield:
display: 'Entry Url'type: textif:
button_type: 'equals entry'more_settings: 'equals true'default: 'http://someurl.com'
- When saving an entry without selecting a
button_type, neither download_asset or entry_url values should be saved, but they are. The reason for this is because any time a field is hidden via a revealer, data flow behaviour changes to always submit those hidden-by-revealer fields.
The solution?
In situations where multiple field conditions are set on a field, we should probably ensure revealer-hidden field values are only submitted and saved if the revealer condition is the ONLY condition responsible for hiding the field. As soon as another field condition is hiding the field (ie. the above button_type condition), then that condition should probably take precedence when it comes to preventing data-flow on save.
Environment
Bug description
As reported by @aerni here #6348 (comment), we found that revealer handling could be improved when multiple conditions are being evaluated.
How to reproduce
button_type, neitherdownload_assetorentry_urlvalues should be saved, but they are. The reason for this is because any time a field is hidden via a revealer, data flow behaviour changes to always submit those hidden-by-revealer fields.The solution?
In situations where multiple field conditions are set on a field, we should probably ensure revealer-hidden field values are only submitted and saved if the revealer condition is the ONLY condition responsible for hiding the field. As soon as another field condition is hiding the field (ie. the above
button_typecondition), then that condition should probably take precedence when it comes to preventing data-flow on save.Environment