Skip to content

Commit

Permalink
Try removing the online channel version from Configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Quetzacoalt91 committed Jan 15, 2025
1 parent f3df360 commit f22cf1a
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 15 deletions.
1 change: 0 additions & 1 deletion classes/Commands/AbstractCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ protected function loadConfiguration(?string $configPath): int
return $controller->run();
}


return ExitCode::SUCCESS;
}
}
9 changes: 0 additions & 9 deletions classes/Parameters/UpgradeConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class UpgradeConfiguration extends ArrayCollection
const ARCHIVE_ZIP = 'archive_zip';
const ARCHIVE_XML = 'archive_xml';
const ARCHIVE_VERSION_NUM = 'archive_version_num';
const ONLINE_VERSION_NUM = 'online_version_num';
const BACKUP_COMPLETED = 'backup_completed';
const INSTALLED_LANGUAGES = 'installed_languages';

Expand Down Expand Up @@ -127,14 +126,6 @@ public function getLocalChannelVersion(): ?string
return $this->get(self::ARCHIVE_VERSION_NUM);
}

/**
* Get the cached version number of the online release.
*/
public function getOnlineChannelVersion(): ?string
{
return $this->get(self::ONLINE_VERSION_NUM);
}

/**
* Get channel selected on config panel (Minor, major ...).
*
Expand Down
3 changes: 0 additions & 3 deletions classes/Upgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ public function getDestinationVersion(): ?string
{
if ($this->updateConfiguration->isChannelLocal()) {
return $this->updateConfiguration->getLocalChannelVersion();
} elseif ($this->updateConfiguration->getOnlineChannelVersion()) {
// Version of online channel has been cached? Return it.
return $this->updateConfiguration->getOnlineChannelVersion();
} else {
return $this->getOnlineDestinationRelease() ? $this->getOnlineDestinationRelease()->getVersion() : null;
}
Expand Down
4 changes: 4 additions & 0 deletions controllers/admin/AdminSelfUpgradeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,11 @@ public function init()
empty($_REQUEST['params']) ? [] : $_REQUEST['params']
);

// TODO: Can be removed when the old UI is not needed anymore
if (!$this->upgradeContainer->getUpdateState()->isInitialized()) {
$this->upgradeContainer->getPrestaShopConfiguration()->fillInUpdateConfiguration(
$this->upgradeContainer->getUpdateConfiguration()
);
$this->upgradeContainer->getUpdateState()->initDefault(
$this->upgradeContainer->getProperty(UpgradeContainer::PS_VERSION),
$this->upgradeContainer->getUpgrader(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,6 @@ public function save(): JsonResponse
$file = $requestConfig[UpgradeConfiguration::ARCHIVE_ZIP];
$fullFilePath = $this->upgradeContainer->getProperty(UpgradeContainer::DOWNLOAD_PATH) . DIRECTORY_SEPARATOR . $file;
$requestConfig[UpgradeConfiguration::ARCHIVE_VERSION_NUM] = $this->upgradeContainer->getPrestashopVersionService()->extractPrestashopVersionFromZip($fullFilePath);
} else {
$requestConfig[UpgradeConfiguration::ONLINE_VERSION_NUM] = $this->upgradeContainer->getUpgrader()->getDestinationVersion();
}

$configurationStorage = $this->upgradeContainer->getConfigurationStorage();
Expand Down

0 comments on commit f22cf1a

Please sign in to comment.