From cd26561491ac00f03d311e25e03b752e3c716aea Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 13 Jul 2023 15:16:17 +1200 Subject: [PATCH] dev/core#4430 Fix regression on searching for emails --- CRM/Core/Form.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 94626883d4..48613449ca 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -1788,12 +1788,13 @@ class CRM_Core_Form extends HTML_QuickForm_Page { } // Core field - get metadata. - $fieldSpec = civicrm_api3($props['entity'], 'getfield', $props); - $fieldSpec = $fieldSpec['values']; + $fieldSpec = civicrm_api3($props['entity'], 'getfield', $props)['values']; $label = $props['label'] ?? $fieldSpec['html']['label'] ?? $fieldSpec['title']; $widget = $props['type'] ?? $fieldSpec['html']['type']; - if ($widget == 'TextArea' && $context == 'search') { + if (in_array($widget, ['TextArea', 'Email'], TRUE) && $context == 'search') { + // Don't require a full email to be entered in search mode. + // See https://lab.civicrm.org/dev/core/-/issues/4430. $widget = 'Text'; } -- 2.25.1