diff --git a/uw_fdsu_theme_resp.theme b/uw_fdsu_theme_resp.theme index bffaa769ece0cd85b4440daee755f91e6f59b304..81f5170f7203cea89588ce9811e33a39ded0d851 100644 --- a/uw_fdsu_theme_resp.theme +++ b/uw_fdsu_theme_resp.theme @@ -410,6 +410,15 @@ function uw_fdsu_theme_resp_preprocess_node(&$variables) { // Get the additional info field. $additional_info = $node->field_uw_ct_contact_info->getValue(); + // If there is additional info, setup render array. + if ($additional_info) { + $additional_info = [ + '#type' => 'processed_text', + '#text' => $additional_info[0]['value'], + '#format' => $additional_info[0]['format'], + ]; + } + // Setup the variables for contact. $variables['contact'] = [ 'title' => $node->getTitle(), @@ -422,17 +431,13 @@ function uw_fdsu_theme_resp_preprocess_node(&$variables) { 'uri' => $profile ? $profile[0]['uri'] : NULL, 'title' => $profile ? $profile[0]['title'] : NULL, ], - 'contact_for' => $node->field_uw_ct_contact_for->value, + 'contact_for' => $node->field_uw_ct_contact_contact_for->value, 'personal_website' => [ 'uri' => $personal_website ? $personal_website[0]['uri'] : NULL, 'title' => $personal_website ? $personal_website[0]['title'] : NULL, ], 'groups' => $uwService->uwGetTermsFromEntityField($node->field_uw_ct_contact_group, 'tags'), - 'additional_info' => [ - '#type' => 'processed_text', - '#text' => $additional_info[0]['value'], - '#format' => $additional_info[0]['format'], - ], + 'additional_info' => $additional_info ? $additional_info : NULL, ]; // Unset the content variable so that we do not