Rock
Rock copied to clipboard
Defined Value with Multiple Values, Enhanced for Long lists, and required issue.
Prerequisites
- [ ] Put an X between the brackets on this line if you have done all of the following: X Can you reproduce the problem on a fresh install or the demo site? X Did you include your Rock version number and client culture setting? X Did you perform a cursory search to see if your bug or enhancement is already reported?
Description
Requiring a Defined Value that allows multiple values and uses the enhanced for long lists settings is show the validation text prior to the user submitting the form. It's always not displayed properly.
Steps to Reproduce
- Add a Defined Value Attribute to Workflow Entry Form
- Set the Attribute to allow multiple Values
- Set the attribute to use the enhanced for long lists setting.
- Load the Workflow form.
Expected behavior:
The field should not show any validation text until the user clicks submit, and the data hasn't been entered.
Actual behavior:
The text "[Attribute Name] is required" displays under the field. It also is messing up the layout of elements below it.
Versions
- Rock Version: [9.4] - [10.1]
- Client Culture Setting: [en-us]
Exported sample workflow to quickly reproduce the issue: https://www.dropbox.com/s/buuqxfes94sdsxa/Test%204176_202004092103.json?dl=0
@nairdo I ran into this same issue when using an enhanced Defined Value control on a block or when using it with an Attribute Matrix. I did a little bit of digging and it appears to be related to an override of the CreateChildControls()
method on the DefinedValuesPickerEnhanced picker class https://github.com/SparkDevNetwork/Rock/blob/af707b43bfa37d45f5b2a26cac6e071e58764c67/Rock/Web/UI/Controls/Pickers/DefinedValuesPickerEnhanced.cs#L173 .
I removed that override in my local instance and the required field validator began working properly and inherited the RFV from the RockListBox. I am confused about the comment above the overridden method. Is there a use case where I am not thinking of where the RFV may be added twice or added when it wasn't supposed to be?