-
Notifications
You must be signed in to change notification settings - Fork 41
Description
Describe the bug
When a boolean field has the attribute default="false" in the view definition, the value is saved as null instead of false.
When left blank, boolean fields are always saved as null. If the value was originally saved as true but the box gets unchecked, it is saved as false. Now, some values in the database are false and some are null despite appearing exactly the same on the form and possibly having the same meaning to the user. After this happens, users cannot change the value back to null using data entry forms. Having the ability to set the default as false would give users more control over the consistency of their data.
To Reproduce
Steps to reproduce the behavior:
- Go to App Resources and choose a form definition
- Click on Collection Object, add this to the view definition, and save
<row>
<cell type="field" id="yn1" name="yesNo1" uitype="checkbox" colspan="3" default="False"/>
</row>
- Create a new Collection Object record
- Fill out required fields and save, leaving the yesNo1 field blank
- Create a Collection Object query
- Add the catalogNumber field and make it equal to the record you created
- Add the yesNo1 field
- Run the query and see the value is null instead of False
Expected behavior
The value should be False by default, as defined in the view definition.
Screenshots
https://ojsmnh20250910-main.test.specifysystems.org/specify/view/collectionobject/65678/
Specify 7 System Information - 2025-12-08T20_26_20.257Z.txt
Please fill out the following information manually:
- OS: Mac
- Browser: Chrome
- Specify 7 Version: 7.11.2 and earlier
- Database Name: ojsmnh_2025_09_10
- Collection name: Fossil Vertebrates
- User Name: spadmin
- URL: https://ojsmnh20250910-main.test.specifysystems.org/specify/