Skip to content
Snippets Groups Projects
Commit 843e6a14 authored by Eric Bremner's avatar Eric Bremner Committed by Eric Bremner
Browse files

ISTWCMS-4704: fixing undefined index errors on contacts

parent e2a04381
No related branches found
No related tags found
1 merge request!34ISTWCMS-4847: adding preprocess to main content area to add classes for 404...
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment