Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix upgrade script #54

Merged
merged 3 commits into from Nov 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.xml
Expand Up @@ -2,7 +2,7 @@
<module>
<name>ps_linklist</name>
<displayName><![CDATA[Link List]]></displayName>
<version><![CDATA[3.0.0]]></version>
<version><![CDATA[3.0.1]]></version>
<description><![CDATA[Adds a block with several links.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
Expand Down
11 changes: 10 additions & 1 deletion ps_linklist.php
Expand Up @@ -35,6 +35,7 @@
use PrestaShop\Module\LinkList\Model\LinkBlockLang;
use PrestaShop\Module\LinkList\Repository\LinkBlockRepository;
use PrestaShop\PrestaShop\Adapter\SymfonyContainer;
use PrestaShop\PrestaShop\Adapter\Cache\CacheClearer;
use PrestaShop\PrestaShop\Adapter\LegacyContext;
use PrestaShop\PrestaShop\Adapter\Shop\Context;

Expand Down Expand Up @@ -66,7 +67,7 @@ public function __construct()
{
$this->name = 'ps_linklist';
$this->author = 'PrestaShop';
$this->version = '3.0.0';
$this->version = '3.0.1';
$this->need_instance = 0;
$this->tab = 'front_office_features';

Expand Down Expand Up @@ -100,6 +101,14 @@ public function install()
&& $this->registerHook('displayFooter')
&& $this->registerHook('actionUpdateLangAfter')
&& $this->installTab()) {
//Clear Symfony cache to update routing rules
$container = SymfonyContainer::getInstance();
if (null !== $container) {
/** @var CacheClearer $cacheClearer */
$cacheClearer = $container->get('prestashop.adapter.cache_clearer');
$cacheClearer->clearAllCaches();
}

return true;
}

Expand Down
13 changes: 12 additions & 1 deletion upgrade/upgrade-3.0.php
Expand Up @@ -27,6 +27,9 @@
exit;
}

use PrestaShop\PrestaShop\Adapter\SymfonyContainer;
use PrestaShop\PrestaShop\Adapter\Cache\CacheClearer;

function upgrade_module_3_0($object)
{
Configuration::deleteByName('FOOTER_CMS');
Expand All @@ -38,9 +41,17 @@ function upgrade_module_3_0($object)
Configuration::deleteByName('FOOTER_CONTACT');
Configuration::deleteByName('FOOTER_SITEMAP');

Db::getInstance()->execute('DROP TABLE `_DB_PREFIX_`cms_block_page');
Db::getInstance()->execute('DROP TABLE `' . _DB_PREFIX_ . 'cms_block_page`');

$object->reset();

//Clear Symfony cache to update routing rules
$container = SymfonyContainer::getInstance();
if (null !== $container) {
/** @var CacheClearer $cacheClearer */
$cacheClearer = $container->get('prestashop.adapter.cache_clearer');
$cacheClearer->clearAllCaches();
}

return true;
}
2 changes: 1 addition & 1 deletion views/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion views/package.json
@@ -1,6 +1,6 @@
{
"name": "ps_linklist",
"version": "3.0.0",
"version": "3.0.1",
"description": "",
"scripts": {
"build": "NODE_ENV=production webpack --progress --colors --debug --display-chunks",
Expand Down