silverstripe-userforms/tests
Dylan Wagstaff c0a30f1b6a
FIX unrequire fields when they become dataless (#1016)
* FIX unrequire fields when they become dataless

When fields that collect input data are changed in configuration via the
CMS to become fields that no longer collect input data (e.g. TextField
-> HTML Block), submitting the resulting form results in a fatal error,
server 500 response, etc. due to trying to check if a field without data
(ever) has data in it.

To circumvent this we can set the required state to false if the field
is being converted to one that does not collect data (which FormField
API conveniently provides a check for).

* Move parent::onBeforeWrite() to top of function

Co-authored-by: Steve Boyd <emteknetnz@gmail.com>
2021-01-17 15:55:47 +13:00
..
Control Clean up tests 2020-06-12 00:55:12 +12:00
Extension FIX account for owner class while removing orphans (#1018) 2021-01-17 15:29:33 +13:00
Form Patch and reorganise some test 2020-01-13 12:15:34 +13:00
FormField FIX Show custom validation message for checkbox and radio groups 2020-07-21 17:30:55 +12:00
Model FIX unrequire fields when they become dataless (#1016) 2021-01-17 15:55:47 +13:00
templates/SilverStripe/UserForms/Tests/Control Update path 2017-10-16 14:56:20 +13:00
UserFormsTest.yml NEW Add folder confirmation modal when adding a new EditableFileField to a userform. (#972) 2020-06-10 16:59:01 +12:00