Remove unused frozen form blocks
authorColeman Watts <coleman@civicrm.org>
Sat, 15 Jan 2022 20:40:37 +0000 (15:40 -0500)
committerColeman Watts <coleman@civicrm.org>
Sat, 15 Jan 2022 20:40:37 +0000 (15:40 -0500)
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
CRM/UF/Form/Field.php
CRM/UF/Form/Group.php

index 1d9db272edb643bcce1e94e2aaa9f433b4e6e228..e33309f0635a3bfd2e612b19f9642fe9b9104e4d 100644 (file)
@@ -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'",
-      ]);
-    }
   }
 
   /**
index b639b71b1496c6bd894744c0d72702ae938ee4d5..36693640277ff2025a844af718cfcf7646fc30a4 100644 (file)
@@ -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);
   }
 
index 07d0c30e8f479b8b13ea2c8cc3df84b614989ce8..3b9b39132dcd4474662c825f6d422841bc68bd30 100644 (file)
@@ -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);
   }