From 5c44e7876559a7126c813e73347837d133b8fd60 Mon Sep 17 00:00:00 2001 From: Thomas Nabord Date: Thu, 6 Jun 2024 11:02:46 +0100 Subject: [PATCH] Remove old controller AdminSelfUpgrade.php manually --- autoupgrade.php | 2 +- config.xml | 19 ++++++++-------- upgrade/install-5.0.3.php | 48 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+), 11 deletions(-) create mode 100644 upgrade/install-5.0.3.php diff --git a/autoupgrade.php b/autoupgrade.php index f41ab7b3d..b2b2ff443 100644 --- a/autoupgrade.php +++ b/autoupgrade.php @@ -36,7 +36,7 @@ public function __construct() $this->name = 'autoupgrade'; $this->tab = 'administration'; $this->author = 'PrestaShop'; - $this->version = '5.0.2'; + $this->version = '5.0.3'; $this->need_instance = 1; $this->bootstrap = true; diff --git a/config.xml b/config.xml index 006e1133d..260423d4d 100644 --- a/config.xml +++ b/config.xml @@ -1,12 +1,11 @@ - autoupgrade - - - - - - 1 - 1 - - + autoupgrade + + + + + + 1 + 1 + \ No newline at end of file diff --git a/upgrade/install-5.0.3.php b/upgrade/install-5.0.3.php new file mode 100644 index 000000000..0cefb1fae --- /dev/null +++ b/upgrade/install-5.0.3.php @@ -0,0 +1,48 @@ + + * @copyright 2007-2022 PrestaShop SA + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + * International Registered Trademark & Property of PrestaShop SA + */ +if (!defined('_PS_VERSION_')) { + exit; +} + +/** + * Manually remove the legacy controller. It has been deleted from the project but remain present while upgrading the module. + * + * @return bool + */ +function upgrade_module_5_0_3($module) +{ + $path = __DIR__ . '/../AdminSelfUpgrade.php'; + if (file_exists($path)) { + $result = @unlink($path); + if ($result !== true) { + PrestaShopLogger::addLog('Could not delete deprecated controller AdminSelfUpgrade.php. ' . $result, 3); + + return false; + } + } + + return true; +}