Files
drmaterac.pl/modules/pagecache/upgrade/Upgrade-9.3.6.php
2025-03-21 20:24:43 +01:00

42 lines
1.7 KiB
PHP

<?php
/**
* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
*
* @author Jpresta
* @copyright Jpresta
* @license See the license of this module in file LICENSE.txt, thank you.
*/
use JPresta\SpeedPack\JprestaUtils;
if (!defined('_PS_VERSION_')) {exit;}
/**
* Make sure pagecache_ignored_params is correctly set
* Page Cache: Bug fixes for PS1.6 and PS1.5
*/
function upgrade_module_9_3_6($module)
{
$mustHave = explode(',', 'fbclid,gclid,utm_id,utm_campaign,utm_content,utm_medium,utm_source,utm_term,_openstat,cm_cat,cm_ite,cm_pla,cm_ven,owa_ad,owa_ad_type,owa_campaign,owa_medium,owa_source,pk_campaign,pk_kwd,WT.mc_t,kwkuniv,srsltid,gad_source,_gl,_ga,cto_pld,gad_source');
foreach (Shop::getContextListShopID() as $id_shop) {
$currentParams = explode(',', JprestaUtils::getConfigurationByShopId('pagecache_ignored_params', $id_shop, ''));
$newList = array_merge($mustHave, $currentParams);
$newList = array_unique($newList);
JprestaUtils::saveConfigurationByShopId('pagecache_ignored_params', implode(',', $newList), $id_shop);
}
if (Tools::version_compare(_PS_VERSION_, '1.7', '<')) {
$module->installOverridesForModules();
PageCache::removeManagedControllerName('hifaq__faq');
Configuration::deleteByName('pagecache_hifaq__faq');
PageCache::removeManagedControllerName('hifaq__faqcategory');
Configuration::deleteByName('pagecache_hifaq__faqcategory');
PageCache::removeManagedControllerName('hifaq__faqdetails');
Configuration::deleteByName('pagecache_hifaq__faqdetails');
$module->upgradeOverride('FrontController');
}
return true;
}