CRM-21328: Remove '-select-' Option From Visibility
authorCamilo Rodriguez <camilo@compucorp.co.uk>
Tue, 24 Oct 2017 17:44:09 +0000 (17:44 +0000)
committerCamilo Rodriguez <camilo@compucorp.co.uk>
Tue, 24 Oct 2017 17:44:09 +0000 (17:44 +0000)
As the visibility per option field is not mandatory, the user can choose the
empty option and save the field. This caused some PHP warnings to be issued on
event registration forms that used the field with empty visibility options.

Removed the empty option from the visibility per option select.

CRM/Price/Form/Field.php

index 75ce1a44b1f67df10ea7ea78a2e57ca652362cd2..d61dd371cbf47402e0285fe5cb7e25adc42fdfb7 100644 (file)
@@ -308,7 +308,7 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
       // is active ?
       $this->add('checkbox', 'option_status[' . $i . ']', ts('Active?'));
 
-      $this->add('select', 'option_visibility_id[' . $i . ']', ts('Visibility'), array('' => ts('- select -')) + $visibilityType);
+      $this->add('select', 'option_visibility_id[' . $i . ']', ts('Visibility'), $visibilityType);
       $defaultOption[$i] = $this->createElement('radio', NULL, NULL, NULL, $i);
 
       //for checkbox handling of default option