Skip to content

Commit

Permalink
Merge pull request #54 from PrestaShop/dev
Browse files Browse the repository at this point in the history
Fix upgrade script
  • Loading branch information
Quetzacoalt91 authored Nov 19, 2018
2 parents 9bf37ec + 02a20c6 commit 87be1d9
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 87be1d9

Please sign in to comment.