From 45586ae88a70e115795201d55db5420d2d343e19 Mon Sep 17 00:00:00 2001 From: Jamie McClelland Date: Tue, 28 Jan 2020 11:48:38 -0500 Subject: [PATCH] avoid undefined offset and uninitialized key errors on upgrade https://lab.civicrm.org/dev/core/issues/1555 --- CRM/Upgrade/Incremental/SmartGroups.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Upgrade/Incremental/SmartGroups.php b/CRM/Upgrade/Incremental/SmartGroups.php index 322f09252d..011c75a4cd 100644 --- a/CRM/Upgrade/Incremental/SmartGroups.php +++ b/CRM/Upgrade/Incremental/SmartGroups.php @@ -287,7 +287,7 @@ class CRM_Upgrade_Incremental_SmartGroups { foreach ($savedSearches as $savedSearch) { $form_values = $savedSearch['form_values']; foreach ($form_values as $index => $formValues) { - if ($formValues[0] === 'custom_' . $custom_date_fields->id && is_array($formValues[2])) { + if (isset($formValues[0]) && $formValues[0] === 'custom_' . $custom_date_fields->id && is_array($formValues[2])) { if (isset($formValues[2]['BETWEEN'])) { $form_values[] = ['custom_' . $custom_date_fields->id . '_low', '=', $this->getConvertedDateValue($formValues[2]['BETWEEN'][0], FALSE)]; $form_values[] = ['custom_' . $custom_date_fields->id . '_high', '=', $this->getConvertedDateValue($formValues[2]['BETWEEN'][1], TRUE)]; -- 2.25.1