From: Eileen McNaughton Date: Thu, 13 Jul 2023 03:16:17 +0000 (+1200) Subject: dev/core#4430 Fix regression on searching for emails X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=cd26561491ac00f03d311e25e03b752e3c716aea;p=civicrm-core.git dev/core#4430 Fix regression on searching for emails --- 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'; }