From eeca4aa5f1de6f0e1cdf814adc4250c713493f12 Mon Sep 17 00:00:00 2001 From: CiviCRM Date: Tue, 23 Jul 2013 10:14:05 +0530 Subject: [PATCH] CRM-13078, added a check to validate the contact id if value is set for that particular row ---------------------------------------- * CRM-13078: http://issues.civicrm.org/jira/browse/CRM-13078 --- CRM/Batch/Form/Entry.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index ecf467447f..55860d91b5 100644 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -242,6 +242,16 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { } } + // if contact name is set for a row using autocomplete widget then make sure contact id exists, CRM-13078 + // I was not able to replicate this on my local but adding this check and hopefully it will fix the issue. + if (!empty($params['primary_contact'])) { + foreach($params['primary_contact'] as $rowIndex => $contactName) { + if (empty($params['primary_contact_select_id'][$rowIndex])) { + $errors['primary_contact['.$rowIndex.']'] = ts('Please select a valid contact.'); + } + } + } + if ($batchTotal != $self->_batchInfo['total']) { $self->assign('batchAmountMismatch', TRUE); $errors['_qf_defaults'] = ts('Total for amounts entered below does not match the expected batch total.'); -- 2.25.1