Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/core#3085 - Checkbox fields on profile admin page can't be unchecked #22916

Merged
merged 1 commit into from
Mar 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CRM/UF/Form/AdvanceSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function buildAdvanceSetting(&$form) {
$form->assign('advancedFieldsConverted', $entityFields);

// should mapping be enabled for this group
$form->addElement('checkbox', 'is_map', ts('Enable mapping for this profile?'));
$form->addElement('advcheckbox', 'is_map', ts('Enable mapping for this profile?'));

// should we allow updates on a exisitng contact
$form->addRadio('is_update_dupe', ts('What to do upon duplicate match'), [ts('Issue warning and do not save'), ts('Update the matching contact'), ts('Allow duplicate contact to be created')]);
Expand All @@ -50,14 +50,14 @@ public static function buildAdvanceSetting(&$form) {
$form->addElement('select', 'add_contact_to_group', ts('Add contacts to a group?'), $group);

// add CAPTCHA To this group ?
$form->addElement('checkbox', 'add_captcha', ts('Include reCAPTCHA?'));
$form->addElement('advcheckbox', 'add_captcha', ts('Include reCAPTCHA?'));

// should we display an edit link
$form->addElement('checkbox', 'is_edit_link', ts('Include profile edit links in search results?'));
$form->addElement('advcheckbox', 'is_edit_link', ts('Include profile edit links in search results?'));

// should we display a link to the website profile
$config = CRM_Core_Config::singleton();
$form->addElement('checkbox', 'is_uf_link', ts('Include %1 user account information links in search results?', [1 => $config->userFramework]));
$form->addElement('advcheckbox', 'is_uf_link', ts('Include %1 user account information links in search results?', [1 => $config->userFramework]));

// want to create cms user
$session = CRM_Core_Session::singleton();
Expand Down
7 changes: 1 addition & 6 deletions CRM/UF/Form/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public function buildQuickForm() {
$this->addRule('weight', ts('is a numeric field'), 'numeric');

// is this group active ?
$this->addElement('checkbox', 'is_active', ts('Is this CiviCRM Profile active?'));
$this->addElement('advcheckbox', 'is_active', ts('Is this CiviCRM Profile active?'));

$paneNames = [
ts('Advanced Settings') => 'buildAdvanceSetting',
Expand Down Expand Up @@ -362,11 +362,6 @@ public function postProcess() {
else {
// get the submitted form values.
$params = $this->controller->exportValues($this->_name);

if (!array_key_exists('is_active', $params)) {
$params['is_active'] = 0;
}

if ($this->_action & (CRM_Core_Action::UPDATE)) {
$params['id'] = $this->_id;
// CRM-5284
Expand Down