update
This commit is contained in:
45
modules/creativeelements/upgrade/upgrade-2.5.0.php
Normal file
45
modules/creativeelements/upgrade/upgrade-2.5.0.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* Creative Elements - live PageBuilder [in-stock]
|
||||
*
|
||||
* @author WebshopWorks
|
||||
* @copyright 2019-2022 WebshopWorks.com
|
||||
* @license In-stock license
|
||||
*/
|
||||
|
||||
defined('_PS_VERSION_') or die;
|
||||
|
||||
function upgrade_module_2_5_0($module)
|
||||
{
|
||||
require_once _CE_PATH_ . 'classes/CEDatabase.php';
|
||||
require_once _CE_PATH_ . 'upgrade/upgrade-2.5.5.php';
|
||||
|
||||
Shop::isFeatureActive() && Shop::setContext(Shop::CONTEXT_ALL);
|
||||
|
||||
Configuration::hasKey('elementor_viewport_lg') or Configuration::updateValue('elementor_viewport_lg', 1025);
|
||||
Configuration::hasKey('elementor_viewport_md') or Configuration::updateValue('elementor_viewport_md', 768);
|
||||
Configuration::hasKey('elementor_global_image_lightbox') or Configuration::updateValue('elementor_global_image_lightbox', 1);
|
||||
Configuration::hasKey('elementor_edit_buttons') or Configuration::updateValue('elementor_edit_buttons', 'on');
|
||||
|
||||
try {
|
||||
// Add `type` to ce_revision table
|
||||
$db = Db::getInstance();
|
||||
$ce_revision = _DB_PREFIX_ . 'ce_revision';
|
||||
$db->execute("ALTER TABLE `$ce_revision` ADD `type` varchar(64) NOT NULL DEFAULT '' AFTER `title`");
|
||||
} catch (Exception $ex) {
|
||||
// Do nothing when `type` already exists
|
||||
}
|
||||
|
||||
foreach (Tab::getCollectionFromModule($module->name) as $tab) {
|
||||
$tab->delete();
|
||||
}
|
||||
CEDatabase::updateTabs();
|
||||
|
||||
// Clear caches
|
||||
CE\Plugin::instance()->files_manager->clearCache();
|
||||
Media::clearCache();
|
||||
|
||||
return $module->registerHook('actionObjectCEContentDeleteAfter') && (
|
||||
version_compare($module->version, '2.5.5', '>=') || upgrade_module_2_5_5($module)
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user