From 7ea7b0883a16dcc9cd4a274ae53e15434c4e60f0 Mon Sep 17 00:00:00 2001 From: colemanw Date: Wed, 21 Jun 2023 20:09:50 -0700 Subject: [PATCH] dev/core#4387 - CRM_Core_Form - Fix params passed to checkbox --- CRM/Core/Form.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index ad88b3b020..a00ab41054 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -547,7 +547,12 @@ class CRM_Core_Form extends HTML_QuickForm_Page { unset($attributes['disabled']); } - $element = $this->addElement($type, $name, CRM_Utils_String::purifyHTML($label), $attributes, $extra); + if ($type === 'checkbox') { + $element = $this->addElement($type, $name, CRM_Utils_String::purifyHTML($label), NULL, $attributes); + } + else { + $element = $this->addElement($type, $name, CRM_Utils_String::purifyHTML($label), $attributes, $extra); + } if (HTML_QuickForm::isError($element)) { CRM_Core_Error::statusBounce(HTML_QuickForm::errorMessage($element)); } -- 2.25.1