From: mgbdev Date: Thu, 14 Nov 2013 12:31:40 +0000 (+0530) Subject: CRM-10225 fix X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0495a6a4a804363783c3e8c1ff3814a66a29a55f;p=civicrm-core.git CRM-10225 fix --- diff --git a/CRM/Price/Form/Field.php b/CRM/Price/Form/Field.php index 5f4d2eb8dd..510b0de3e1 100644 --- a/CRM/Price/Form/Field.php +++ b/CRM/Price/Form/Field.php @@ -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',