- Issue created by @rkoller
- First commit to issue fork.
- ๐ฎ๐ณIndia annmarysruthy
@rkoller why do we need N/A in the set default value even when field is not required. When field is not required and and on clicking set default value , we can see option N/A . If I select N/A as default value and on saving, no default value gets saved. On editing the form again, set default value is left unchecked. The issue you mentioned occurs irrespective of whether the field is required or not
Can we remove the N/A option from set default value for both required and not required fields and keep N/A in form display only when field is not required. That is if there is a boolean field 'field1' which is not required, on adding article content type field1 will have N/A option but on editing field field1, the set default value will not have N/A. if field1 is required, then both places wont be having N/A.
Proposed Solution:
Remove N/A from the options in set default value irrespective of whether the field is required or not.
- First commit to issue fork.
- Status changed to Needs review
5 months ago 10:45am 1 August 2024 - ๐ฎ๐ณIndia arunkumark Coimbatore
Created MR to exclude the N/A or Empty option from the Boolean fields.
- ๐ฎ๐ณIndia prem suthar Ahemdabad- Gujrat , Jodhpur - Rajsthan
@ararunkumark
I have attached a screenshot showing the behaviour of the form field with required and non-required values. When the field is required, the "N/A" option should be hidden. However, if the field is changed back to non-required, the "N/A" option should be shown again.
With the Required Field is Working Fine as of now.
Thanks.
- ๐ฎ๐ณIndia arunkumark Coimbatore
@Prem Suthar
The solution implemented based on the Proposed resolution and #5 ๐ Remove the N/A option from the list of default values for a required boolean field Needs review . There are 2 types of Field Types using the form display radios.
Type 1. Listing Text/Integer/Float (1 value in storage )
In this case, we have to choose Checkbox/Radio in the Form display. If the field allows 1 value on the storage, the field will render as Radios. The testing you did will work on this scenario.
Type 2. Boolean
But in Boolean type always 2 values TRUE or FALSE (i.e 1 or 0). In this case, we should not show the N/A option either required or not required.Note: The field type 1 will accept multiple values, the Form field is rendered as a checkbox.
- Status changed to Needs work
5 months ago 12:05am 5 August 2024 - ๐บ๐ธUnited States smustgrave
What about the people who have that option currently selected. Believe will need upgrade path of some kind with test coverage of that update.
- ๐ฎ๐ณIndia arunkumark Coimbatore
@smustgrave
If any user selected N/A or kept unselected there is no entry in the Database. Also, if the user edits the same entity it remains unselect of N/A. So, the N/A option is only shown in Form, there is no logic in data save.
Selected N/A:
Edited the same node:
So, there is no impact in existing users who selected N/A