From 565df8cf7c41e8dabf95a7e8dc3e99c6f3d95c23 Mon Sep 17 00:00:00 2001 From: Edsel Date: Wed, 14 May 2014 15:22:10 +0530 Subject: [PATCH] CRM-14683 Fixed constraint violation when batch update for grant is performed ---------------------------------------- * CRM-14683: Update Grant causes DB Error: constraint violation https://issues.civicrm.org/jira/browse/CRM-14683 --- CRM/Grant/Form/Task/Update.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/CRM/Grant/Form/Task/Update.php b/CRM/Grant/Form/Task/Update.php index 9e67348ec0..a27da62598 100644 --- a/CRM/Grant/Form/Task/Update.php +++ b/CRM/Grant/Form/Task/Update.php @@ -101,18 +101,15 @@ class CRM_Grant_Form_Task_Update extends CRM_Grant_Form_Task { $values[$key] = $value; } foreach ($this->_grantIds as $grantId) { - $ids['grant'] = $grantId; + $ids['grant_id'] = $grantId; CRM_Grant_BAO_Grant::add($values, $ids); $updatedGrants++; } } - $status = array( - ts('Updated Grant(s): %1', array(1 => $updatedGrants)), - ts('Total Selected Grant(s): %1', array(1 => count($this->_grantIds))), - ); - CRM_Core_Session::setStatus($status); + CRM_Core_Session::setStatus(ts('Updated Grant(s): %1', array(1 => $updatedGrants)), '', 'info'); + CRM_Core_Session::setStatus(ts('Total Selected Grant(s): %1', array(1 => count($this->_grantIds))), '', 'info'); CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/grant/search', 'force=1&qfKey=' . $qfKey)); } } -- 2.25.1