From 54b595ce3f1175cdede25a4d240bf2d0132bc747 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 8 May 2025 12:13:17 +0530 Subject: [PATCH] Cache is not cleaned after using the cleaner, which shows the old data from the cache --- modules/qlocleaner/qlocleaner.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/qlocleaner/qlocleaner.php b/modules/qlocleaner/qlocleaner.php index 6ba70f67c..a475b0c55 100644 --- a/modules/qlocleaner/qlocleaner.php +++ b/modules/qlocleaner/qlocleaner.php @@ -85,6 +85,7 @@ class QloCleaner extends Module } Hook::exec('actionCleanData', array('method' => 'checkAndFix')); $html .= $this->displayConfirmation($conf); + Cache::getInstance()->flush(); } elseif (Tools::isSubmit('submitCleanAndOptimize')) { $logs = self::cleanAndOptimize(); if (count($logs)) { @@ -95,14 +96,17 @@ class QloCleaner extends Module } Hook::exec('actionCleanData', array('method' => 'cleanAndOptimize')); $html .= $this->displayConfirmation($conf); + Cache::getInstance()->flush(); } elseif (Tools::getValue('submitTruncateCatalog') && Tools::getValue('checkTruncateCatalog')) { self::truncate('catalog'); Hook::exec('actionCleanData', array('method' => 'catalog')); $html .= $this->displayConfirmation($this->l('Catalog truncated successfuly, please run functional Integrity constraints to clean the database.')); + Cache::getInstance()->flush(); } elseif (Tools::getValue('submitTruncateSales') && Tools::getValue('checkTruncateSales')) { self::truncate('sales'); Hook::exec('actionCleanData', array('method' => 'sales')); $html .= $this->displayConfirmation($this->l('Orders and customers truncated successfuly, please run functional Integrity constraints to clean the database')); + Cache::getInstance()->flush(); } $html .= $this->context->smarty->fetch(_PS_MODULE_DIR_.$this->name.'/views/templates/admin/qlocleaner_script.tpl');