When on the "Manage form display" tab of a content type (/admin/structure/types/manage//form-display), and you add a field group, and specify a CSS ID like "#something" (which is invalid due to the '#' character), and click Update, it will trigger an error in field_group_validate_id().
Currently the call to setError() which is triggering the error is on line 62. However, the setError() method is no longer on the FormBuilderInterface object as the code assumes, but on the FormStateInterface object.
The PHP error:
Error: Call to undefined method Drupal\Core\Form\FormBuilder::setError() in /.../htdocs/modules/contrib/field_group/includes/helpers.inc on line 62 #0 [internal function]: field_group_validate_id(Array, Object(Drupal\Core\Form\FormState), Array)
The result of the PHP error is an HTTP 500 response for the AJAX call, and no error is displayed until you save the form, at which point you get a blank screen with only the message "The website encountered an unexpected error. Please try again later.".
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | field_group_validate_set_error-2949775-3.patch | 849 bytes | chewi3 |
Comments
Comment #2
mossy2100Comment #3
chewi3 commented"setError" is now called on form state instead of form builder.
Comment #5
nils.destoop commentedThx for the patch. Committed it to dev