if (!empty($lineItem)) {
$itemId = key($lineItem);
foreach ($lineItem as &$eachItem) {
- if (is_array($this->_relatedObjects['membership']) && array_key_exists($eachItem['membership_type_id'], $this->_relatedObjects['membership'])) {
+ if (isset($this->_relatedObjects['membership'])
+ && is_array($this->_relatedObjects['membership'])
+ && array_key_exists($eachItem['membership_type_id'], $this->_relatedObjects['membership'])) {
$eachItem['join_date'] = CRM_Utils_Date::customFormat($this->_relatedObjects['membership'][$eachItem['membership_type_id']]->join_date);
$eachItem['start_date'] = CRM_Utils_Date::customFormat($this->_relatedObjects['membership'][$eachItem['membership_type_id']]->start_date);
$eachItem['end_date'] = CRM_Utils_Date::customFormat($this->_relatedObjects['membership'][$eachItem['membership_type_id']]->end_date);
$recurParams['trxn_id'] = CRM_Utils_Array::value('trxn_id', $params, $params['invoiceID']);
$recurParams['financial_type_id'] = $contributionType->id;
- if ($form->_values['is_monetary']) {
+ if (!empty($form->_values['is_monetary'])) {
$recurParams['payment_instrument_id'] = 1;
}