From b9b57c08258092292635ce4f9d42440fb078f99d Mon Sep 17 00:00:00 2001 From: Alexis Guyomar Date: Thu, 6 Feb 2025 17:13:05 +0100 Subject: [PATCH] fix: use state version if initialized instead using core files --- classes/UpgradeContainer.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/classes/UpgradeContainer.php b/classes/UpgradeContainer.php index f03527ecb..e6c2ceb1e 100644 --- a/classes/UpgradeContainer.php +++ b/classes/UpgradeContainer.php @@ -282,7 +282,7 @@ public function getProperty(string $property): ?string case self::ARCHIVE_FILEPATH: return $this->getProperty(self::DOWNLOAD_PATH) . DIRECTORY_SEPARATOR . $this->getProperty(self::ARCHIVE_FILENAME); case self::PS_VERSION: - return $this->getPrestaShopConfiguration()->getPrestaShopVersion(); + return $this->getCurrentPrestaShopVersion(); default: return ''; } @@ -361,6 +361,15 @@ public function getChecksumCompare(): ChecksumCompare return $this->checksumCompare; } + public function getCurrentPrestaShopVersion(): string + { + if ($this->getUpdateState()->isInitialized()) { + return $this->getUpdateState()->getCurrentVersion(); + } + + return $this->getPrestaShopConfiguration()->getPrestaShopVersion(); + } + public function getComposerService(): ComposerService { if (null === $this->composerService) {