silverstripe-userforms/code
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 ENH Move jQuery include away from CDN (#1019) 2021-01-17 14:37:01 +13:00
Extension FIX account for owner class while removing orphans (#1018) 2021-01-17 15:29:33 +13:00
Form Minor linting adjustment. 2020-01-14 12:28:04 +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
Modifier API Implement upgrader cleanup, array declaration changes, class injection, rename some models 2017-08-22 16:40:15 +12:00
Task Merge branch '5.4' into 5.5 2020-05-26 15:11:46 +12:00
UserForm.php BUG Remove old boostrap 3 CSS class 2020-09-16 11:38:33 +12:00