----------------------------------------
* CRM-16535: Cannot record contributions in a data entry batch of type pledge payment
https://issues.civicrm.org/jira/browse/CRM-16535
}
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.');
}