From 6c97864e881278c25ac1814c4b2dc8f146ea337c Mon Sep 17 00:00:00 2001 From: kurund Date: Thu, 29 Aug 2013 18:55:34 +0530 Subject: [PATCH] CRM-13066, update the code accord to schema changes ---------------------------------------- * CRM-13066: 'Clean up Caches' deletes in progress batches http://issues.civicrm.org/jira/browse/CRM-13066 --- CRM/Batch/Form/Entry.php | 7 ++++--- CRM/Batch/Page/AJAX.php | 8 ++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CRM/Batch/Form/Entry.php b/CRM/Batch/Form/Entry.php index 78ca715740..cfedc822fd 100644 --- a/CRM/Batch/Form/Entry.php +++ b/CRM/Batch/Form/Entry.php @@ -337,10 +337,11 @@ class CRM_Batch_Form_Entry extends CRM_Core_Form { } } else { - // get the existing batch values from cache table - $cacheKeyString = CRM_Batch_BAO_Batch::getCacheKeyForBatch($this->_batchId); - $defaults = CRM_Core_BAO_Cache::getItem('batch entry', $cacheKeyString); + // get the cached info from data column of civicrm_batch + $data = CRM_Core_DAO::getFieldValue('CRM_Batch_BAO_Batch', $this->_batchId, 'data'); + $defaults = json_decode($data, TRUE); } + return $defaults; } diff --git a/CRM/Batch/Page/AJAX.php b/CRM/Batch/Page/AJAX.php index 6b39b7120b..f3f6bff75c 100644 --- a/CRM/Batch/Page/AJAX.php +++ b/CRM/Batch/Page/AJAX.php @@ -42,16 +42,12 @@ class CRM_Batch_Page_AJAX { * Save record */ function batchSave() { - // save in cache table + // save the entered information in 'data' column $batchId = CRM_Utils_Type::escape($_POST['batch_id'], 'Positive'); - $cacheKeyString = CRM_Batch_BAO_Batch::getCacheKeyForBatch($batchId); - - // check if we can retrieve from database cache unset($_POST['qfKey']); - CRM_Core_BAO_Cache::setItem($_POST, 'batch entry', $cacheKeyString); + CRM_Core_DAO::setFieldValue('CRM_Batch_DAO_Batch', $batchId, 'data', json_encode($_POST)); - // return true if saved correctly CRM_Utils_System::civiExit(); } -- 2.25.1