From a41f11e2297f104ce8628076edb8d6eaed287709 Mon Sep 17 00:00:00 2001 From: Jagadedes Date: Tue, 25 Nov 2014 11:35:23 +0530 Subject: [PATCH] 31603 progress bar update not clearing widget cache --- CRM/Wci/BAO/WidgetCache.php | 4 ++-- CRM/Wci/Form/ProgressBar.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Wci/BAO/WidgetCache.php b/CRM/Wci/BAO/WidgetCache.php index 8574368..a06dd7d 100644 --- a/CRM/Wci/BAO/WidgetCache.php +++ b/CRM/Wci/BAO/WidgetCache.php @@ -70,10 +70,10 @@ class CRM_Wci_BAO_WidgetCache extends CRM_Wci_DAO_WidgetCache { array(1 => array($widgetId, 'Integer')), TRUE, 'CRM_Wci_DAO_WidgetCache'); } - public static function clearCache($pbId) { + public static function deleteWidgetCacheByProgressbar($pbId) { $query = "SELECT wc.widget_id FROM civicrm_wci_widget_cache as wc INNER JOIN civicrm_wci_widget w on w.id = wc.widget_id WHERE w.progress_bar_id =%1"; $dao = CRM_Core_DAO::executeQuery($query, array(1 => array($pbId, 'Integer')), TRUE, 'CRM_Wci_DAO_WidgetCache'); - if ($dao->fetch()) { + while ($dao->fetch()) { $widget_id = $dao->widget_id; CRM_Wci_BAO_WidgetCache::deleteWidgetCache($widget_id); } diff --git a/CRM/Wci/Form/ProgressBar.php b/CRM/Wci/Form/ProgressBar.php index 866aff1..650345b 100644 --- a/CRM/Wci/Form/ProgressBar.php +++ b/CRM/Wci/Form/ProgressBar.php @@ -190,7 +190,7 @@ class CRM_Wci_Form_ProgressBar extends CRM_Core_Form { } $transaction->commit(); - CRM_Wci_BAO_WidgetCache::clearCache($this->_id); + CRM_Wci_BAO_WidgetCache::deleteWidgetCacheByProgressbar($this->_id); CRM_Core_Session::setStatus(ts('Progress bar created successfuly'), '', 'success'); CRM_Utils_System::redirect('progress-bar?reset=1'); } -- 2.25.1