From 51661ce1f0fdc88733124a29ba0483f08a8dfc73 Mon Sep 17 00:00:00 2001 From: larssandergreen Date: Sun, 23 Apr 2023 13:34:22 -0600 Subject: [PATCH] use labels from schema for selects --- CRM/Core/Form.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 78dc7e462a..ad88b3b020 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -1688,7 +1688,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { break; } } - $label = $props['label'] ?? $fieldSpec['title']; + $label = $props['label'] ?? $fieldSpec['html']['label'] ?? $fieldSpec['title']; if (CRM_Utils_Array::value('context', $props) != 'search') { $props['data-option-edit-path'] = array_key_exists('option_url', $props) ? $props['option_url'] : CRM_Core_PseudoConstant::getOptionEditUrl($fieldSpec); } @@ -1785,8 +1785,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { // Core field - get metadata. $fieldSpec = civicrm_api3($props['entity'], 'getfield', $props); $fieldSpec = $fieldSpec['values']; - $fieldSpecLabel = $fieldSpec['html']['label'] ?? CRM_Utils_Array::value('title', $fieldSpec); - $label = CRM_Utils_Array::value('label', $props, $fieldSpecLabel); + $label = $props['label'] ?? $fieldSpec['html']['label'] ?? $fieldSpec['title']; $widget = $props['type'] ?? $fieldSpec['html']['type']; if ($widget == 'TextArea' && $context == 'search') { -- 2.25.1