From: pratikshad Date: Fri, 29 May 2015 09:21:34 +0000 (+0530) Subject: CRM-16535 Fix-Cannot record contributions in a data entry batch of type pledge payment X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=42724136379341e65473bf0d62d0aeb0a7d93d89;p=civicrm-core.git CRM-16535 Fix-Cannot record contributions in a data entry batch of type pledge payment ---------------------------------------- * CRM-16535: Cannot record contributions in a data entry batch of type pledge payment https://issues.civicrm.org/jira/browse/CRM-16535 --- diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index fea1fe1868..6357f3ed46 100755 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -323,8 +323,10 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { } if ($self->_batchInfo['type_id'] == $batchTypes['Pledge Payment']) { foreach (array_unique($params["open_pledges"]) as $value) { - $duplicateRows = array_keys($params["open_pledges"], $value); - if (count($duplicateRows) > 1) { + if (!empty($value)) { + $duplicateRows = array_keys($params["open_pledges"], $value); + } + if (!empty($duplicateRows) && count($duplicateRows) > 1) { foreach ($duplicateRows as $key) { $errors["open_pledges[$key]"] = ts('You can not record two payments for the same pledge in a single batch.'); }