From e78a705493cf14621c99d931a5f3d091d9e47855 Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 26 Mar 2020 13:17:33 +1300 Subject: [PATCH] Fix bug on handling 'is_required' The code was expecting 'Select' but we encourage 'select' in the settings spec However, we DO know the case to expect for the quickFormType - so check that instead --- CRM/Admin/Form/SettingTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Admin/Form/SettingTrait.php b/CRM/Admin/Form/SettingTrait.php index f1d0e91893..5c52de39e9 100644 --- a/CRM/Admin/Form/SettingTrait.php +++ b/CRM/Admin/Form/SettingTrait.php @@ -164,7 +164,7 @@ trait CRM_Admin_Form_SettingTrait { if (isset($quickFormType)) { $options = $props['options'] ?? NULL; if ($options) { - if ($props['html_type'] === 'Select' && isset($props['is_required']) && $props['is_required'] === FALSE && !isset($options[''])) { + if ($quickFormType === 'Select' && isset($props['is_required']) && $props['is_required'] === FALSE && !isset($options[''])) { // If the spec specifies the field is not required add a null option. // Why not if empty($props['is_required']) - basically this has been added to the spec & might not be set to TRUE // when it is true. -- 2.25.1