viewOnly parameter is not used in buildCustom for Registration
authorMatthew Wire <mjw@mjwconsult.co.uk>
Mon, 26 Apr 2021 21:52:43 +0000 (22:52 +0100)
committerMatthew Wire <mjw@mjwconsult.co.uk>
Tue, 27 Apr 2021 10:00:40 +0000 (11:00 +0100)
CRM/Event/Form/Registration.php

index fea27e9eb438a2386f52330f9d3035fc21c336d4..95a1de04101aea74abece319eb241c90b12f692d 100644 (file)
@@ -487,9 +487,8 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
    *
    * @param int $id
    * @param string $name
-   * @param bool $viewOnly
    */
-  public function buildCustom($id, $name, $viewOnly = FALSE) {
+  public function buildCustom($id, $name) {
     if (!$id) {
       return;
     }
@@ -553,13 +552,6 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
     if (is_array($fields)) {
       $button = substr($this->controller->getButtonName(), -4);
       foreach ($fields as $key => $field) {
-        if ($viewOnly &&
-          isset($field['data_type']) &&
-          $field['data_type'] == 'File' || ($viewOnly && $field['name'] == 'image_URL')
-        ) {
-          // ignore file upload fields
-          continue;
-        }
         //make the field optional if primary participant
         //have been skip the additional participant.
         if ($button == 'skip') {
@@ -576,7 +568,7 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
       }
     }
 
-    if ($addCaptcha && !$viewOnly) {
+    if ($addCaptcha) {
       CRM_Utils_ReCAPTCHA::enableCaptchaOnForm($this);
     }
   }