From 7404ae8705275c2272e84fe60e404eb68eb2ee70 Mon Sep 17 00:00:00 2001 From: Jonathan Danse Date: Wed, 29 Dec 2021 11:45:24 +0100 Subject: [PATCH] Do not use hook AdminStatsModules alias, use displayAdminStatsModules & Bump version to 2.0.2 --- config.xml | 2 +- pagesnotfound.php | 6 +++--- upgrade/upgrade-2.0.2.php | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 upgrade/upgrade-2.0.2.php diff --git a/config.xml b/config.xml index d17fe0c..c15196c 100755 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ pagesnotfound - + diff --git a/pagesnotfound.php b/pagesnotfound.php index 87c0a67..87dacb7 100644 --- a/pagesnotfound.php +++ b/pagesnotfound.php @@ -35,7 +35,7 @@ public function __construct() { $this->name = 'pagesnotfound'; $this->tab = 'analytics_stats'; - $this->version = '2.0.1'; + $this->version = '2.0.2'; $this->author = 'PrestaShop'; $this->need_instance = 0; @@ -50,7 +50,7 @@ public function install() { if (!parent::install() || !$this->registerHook('displayTop') - || !$this->registerHook('AdminStatsModules') + || !$this->registerHook('displayAdminStatsModules') ) { return false; } @@ -99,7 +99,7 @@ private function getPages() return $pages; } - public function hookAdminStatsModules() + public function hookDisplayAdminStatsModules() { if (Tools::isSubmit('submitTruncatePNF')) { diff --git a/upgrade/upgrade-2.0.2.php b/upgrade/upgrade-2.0.2.php new file mode 100644 index 0000000..7b01a2a --- /dev/null +++ b/upgrade/upgrade-2.0.2.php @@ -0,0 +1,33 @@ + + + * @copyright Since 2007 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + */ + +/** + * @param Module $module + * + * @return bool + */ +function upgrade_module_2_0_2$module) +{ + $module->unregisterHook('AdminStatsModules'); + $module->registerHook('displayAdminStatsModules'); + + return true; +}