From c289fcf4fdabd0ec880bdd28ee8ea38172b50514 Mon Sep 17 00:00:00 2001 From: Daniel Sasser Date: Wed, 5 Apr 2023 14:50:27 -0700 Subject: [PATCH] VACMS-12800: Resolves PHP warning about missing #type by selectively applying #states to group_q_a_page_components form elements. (#13177) Co-authored-by: Daniel Sasser --- docroot/modules/custom/va_gov_backend/va_gov_backend.module | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docroot/modules/custom/va_gov_backend/va_gov_backend.module b/docroot/modules/custom/va_gov_backend/va_gov_backend.module index c4af78d07..dbc39fbae 100644 --- a/docroot/modules/custom/va_gov_backend/va_gov_backend.module +++ b/docroot/modules/custom/va_gov_backend/va_gov_backend.module @@ -523,7 +523,9 @@ function va_gov_backend_form_alter(&$form, FormStateInterface $form_state, $form */ function va_gov_backend_field_group_form_process_build_alter(array &$form, FormStateInterface $form_state, &$element) { // Toggle group Q&A component visibility. - $form['group_q_a_page_components']['#states']['visible']['input[data-drupal-selector="edit-field-standalone-page-value"]'] = ['checked' => TRUE]; + if (!empty($form['group_q_a_page_components'])) { + $form['group_q_a_page_components']['#states']['visible']['input[data-drupal-selector="edit-field-standalone-page-value"]'] = ['checked' => TRUE]; + } } /**