From e5762a580cc66cff71fd0ac8e3c02a1c09211e61 Mon Sep 17 00:00:00 2001 From: Jim Vomero Date: Thu, 28 Sep 2023 23:45:26 -0400 Subject: [PATCH] fix (YALB-1566): fix update hook by ensuring content exists (#439) --- .../modules/custom/ys_layouts/src/UpdateExistingNodes.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/profiles/custom/yalesites_profile/modules/custom/ys_layouts/src/UpdateExistingNodes.php b/web/profiles/custom/yalesites_profile/modules/custom/ys_layouts/src/UpdateExistingNodes.php index 59ca2ceb83..87f7431757 100644 --- a/web/profiles/custom/yalesites_profile/modules/custom/ys_layouts/src/UpdateExistingNodes.php +++ b/web/profiles/custom/yalesites_profile/modules/custom/ys_layouts/src/UpdateExistingNodes.php @@ -97,7 +97,8 @@ public function updateExistingPageMeta() { $section_storage = $stored_data->data['section_storage']; if ( - $section_storage->getSections()[1]->getLayoutSettings()['label'] == 'Title Section' + !empty($section_storage->getSections()[1]) + && $section_storage->getSections()[1]->getLayoutSettings()['label'] == 'Title Section' && $stored_data->data['section_storage']->getContext('entity')->getContextData()->getEntity()->bundle() == 'page') { $section_storage = $stored_data->data['section_storage'];