-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information
1 parent
a427296
commit c0a30f1
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters