From 43cc411a2733f465c9c97493a4c5a355c99bba12 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 15 Jan 2022 15:40:37 -0500 Subject: [PATCH] Remove unused frozen form blocks These blocks appear to be unused because these forms are never displayed in frozen "view" mode. If they were in use they would be broken because the urls are incorrectly output raw instead of being properly passed to `CRM_Utils_System::url()`. --- CRM/Custom/Form/Group.php | 9 --------- CRM/UF/Form/Field.php | 11 ----------- CRM/UF/Form/Group.php | 9 --------- 3 files changed, 29 deletions(-) diff --git a/CRM/Custom/Form/Group.php b/CRM/Custom/Form/Group.php index 1d9db272ed..e33309f063 100644 --- a/CRM/Custom/Form/Group.php +++ b/CRM/Custom/Form/Group.php @@ -317,15 +317,6 @@ class CRM_Custom_Form_Group extends CRM_Core_Form { $buttons[0]['class'] = 'crm-warnDataLoss'; } $this->addButtons($buttons); - - // TODO: Is this condition ever true? Can this code be removed? - if ($this->_action & CRM_Core_Action::VIEW) { - $this->freeze(); - $this->addElement('xbutton', 'done', ts('Done'), [ - 'type' => 'button', - 'onclick' => "location.href='civicrm/admin/custom/group?reset=1&action=browse'", - ]); - } } /** diff --git a/CRM/UF/Form/Field.php b/CRM/UF/Form/Field.php index b639b71b14..3669364027 100644 --- a/CRM/UF/Form/Field.php +++ b/CRM/UF/Form/Field.php @@ -464,17 +464,6 @@ class CRM_UF_Form_Field extends CRM_Core_Form { $this->addFormRule(['CRM_UF_Form_Field', 'formRule'], $this); - // if view mode pls freeze it with the done button. - if ($this->_action & CRM_Core_Action::VIEW) { - $this->freeze(); - $this->addElement('xbutton', 'done', ts('Done'), - [ - 'type' => 'button', - 'onclick' => "location.href='civicrm/admin/uf/group/field?reset=1&action=browse&gid=" . $this->_gid . "'", - ] - ); - } - $this->setDefaults($defaults); } diff --git a/CRM/UF/Form/Group.php b/CRM/UF/Form/Group.php index 07d0c30e8f..3b9b39132d 100644 --- a/CRM/UF/Form/Group.php +++ b/CRM/UF/Form/Group.php @@ -235,15 +235,6 @@ class CRM_UF_Form_Group extends CRM_Core_Form { ], ]); - // views are implemented as frozen form - if ($this->_action & CRM_Core_Action::VIEW) { - $this->freeze(); - $this->addElement('xbutton', 'done', ts('Done'), [ - 'type' => 'button', - 'onclick' => "location.href='civicrm/admin/uf/group?reset=1&action=browse'", - ]); - } - $this->addFormRule(['CRM_UF_Form_Group', 'formRule'], $this); } -- 2.25.1