Enable participant roles to be changed from counted to not counted
authorKirk Jackson <kirk@caat.org.uk>
Thu, 14 Nov 2013 16:02:51 +0000 (16:02 +0000)
committerKirk Jackson <kirk@caat.org.uk>
Thu, 14 Nov 2013 16:19:35 +0000 (16:19 +0000)
CRM/Admin/Form/Options.php

index 50f413e46fdce800dc52205a47272107b1408744..ec2f9327fd20385972c9ad430905389a1c0f4f2c 100644 (file)
@@ -395,9 +395,13 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
         }
       }
 
-      // set db value of filter in params if filter is non editable
-      if ($this->_id && !array_key_exists('filter', $params) && !$this->_gName == 'participant_role') {
-        $params['filter'] = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'filter', 'id');
+      // set value of filter if not present in params
+      if ($this->_id && !array_key_exists('filter', $params)) {
+        if ($this->_gName == 'participant_role') {
+          $params['filter'] = 0;
+        } else {
+          $params['filter'] = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionValue', $this->_id, 'filter', 'id');
+        }
       }
 
       $groupParams = array('name' => ($this->_gName));