CRM-10225 fix
authormgbdev <mgbdev@gmail.com>
Thu, 14 Nov 2013 12:31:40 +0000 (18:01 +0530)
committermgbdev <mgbdev@gmail.com>
Thu, 14 Nov 2013 12:52:46 +0000 (18:22 +0530)
CRM/Price/Form/Field.php

index 5f4d2eb8ddb8f4552a776611e8df497b1d2f99b3..510b0de3e1e7da17da1d2be8335324694fd16273 100644 (file)
@@ -153,7 +153,11 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
       $defaults['options_per_line'] = 1;
       $defaults['is_display_amounts'] = 1;
     }
-    $eventComponentId  = CRM_Core_Component::getComponentID('CiviEvent');
+    $enabledComponents = CRM_Core_Component::getEnabledComponents();
+    $eventComponentId = NULL;
+    if (array_key_exists('CiviEvent',$enabledComponents)){
+      $eventComponentId  = CRM_Core_Component::getComponentID('CiviEvent');
+    }
 
     if (isset($this->_sid) && $this->_action == CRM_Core_Action::ADD) {
       $financialTypeId = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $this->_sid, 'financial_type_id');
@@ -197,9 +201,15 @@ class CRM_Price_Form_Field extends CRM_Core_Form {
     if (count($financialType)) {
       $this->assign('financialType', $financialType);
     }
+    $enabledComponents = CRM_Core_Component::getEnabledComponents();
+    $eventComponentId = $memberComponentId = NULL;
+    if (array_key_exists('CiviEvent',$enabledComponents)) {
+      $eventComponentId  = CRM_Core_Component::getComponentID('CiviEvent');
+    }
+    if (array_key_exists('CiviMember',$enabledComponents)) {
+      $memberComponentId = CRM_Core_Component::getComponentID('CiviMember');
+    }
 
-    $eventComponentId  = CRM_Core_Component::getComponentID('CiviEvent');
-    $memberComponentId = CRM_Core_Component::getComponentID('CiviMember');
     $attributes        = CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceFieldValue');
 
     $this->add('select', 'financial_type_id',