-
Notifications
You must be signed in to change notification settings - Fork 4
Description
A nullable field may have null as a value in its enum property. This will result in an error like this:
TypeError: SchemaForms\Drupal\FormGeneratorDrupal::SchemaForms\Drupal{closure}(): Argument #2 ($opt) must be of type string, null given in SchemaForms\Drupal\FormGeneratorDrupal->SchemaForms\Drupal{closure}() (line 497 of /var/www/html/vendor/e0ipso/schema-forms/src/Drupal/FormGeneratorDrupal.php).
The error is triggered by the string type declaration on $opt in the anonymous function inside FormGeneratorDrupal::transformRadios() or ::transformCheckboxes().
I an imagine a similar thing happening if the values are integers.
There needs to be code to handle the case where $opt is not a string.
This problem leads to: https://www.drupal.org/project/sdc_display/issues/3478346