Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This error is shown when submitting the config form.
"Cannot use object of type Drupal\Core\Form\FormState as array"
This is due to the fact that the FormState isn't an array any more, but an object. Use $form_state->getValue('key_name');
Comment | File | Size | Author |
---|---|---|---|
#3 | 2807925.patch | 8.16 KB | Web-Beest |
Comments
Comment #2
Web-BeestComment #3
Web-BeestReworked patch.
Comment #4
drupalguy854 CreditAttribution: drupalguy854 commentedIs there a way to get all the form_state variables that are in there and print them to the screen with a function like echo var_export($formstatevariablehere) without specifying just one key?