EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
Ref installer
Yuriie88b37889485
diff --git a/application/Espo/Core/Upgrades/Actions/Base.php b/application/Espo/Core/Upgrades/Actions/Base.phpindex f84a436469..1c439135cd 100644--- a/application/Espo/Core/Upgrades/Actions/Base.php+++ b/application/Espo/Core/Upgrades/Actions/Base.php@@ -433,11 +433,12 @@ abstract class Base** @throws Error*/- protected function getPath(string $name = 'packagePath', bool $isPackage = false): string+ protected function getPath(string $name, bool $isPackage = false): string{$postfix = $isPackage ? $this->packagePostfix : '';- $processId = $this->getProcessId();+ $processId = basename($this->getProcessId());+$path = Util::concatPath($this->getParam($name), $processId);return $path . $postfix;diff --git a/application/Espo/Core/Upgrades/Actions/Base/Uninstall.php b/application/Espo/Core/Upgrades/Actions/Base/Uninstall.phpindex 40600207b2..09c21d8fec 100644--- a/application/Espo/Core/Upgrades/Actions/Base/Uninstall.php+++ b/application/Espo/Core/Upgrades/Actions/Base/Uninstall.php@@ -112,7 +112,6 @@ class Uninstall extends Base*/protected function restoreFiles(): bool{- /** @noinspection PhpRedundantOptionalArgumentInspection */$packagePath = $this->getPath('packagePath');$manifestPath = Util::concatPath($packagePath, $this->manifestName);diff --git a/tests/unit/Espo/Core/Upgrades/Actions/BaseTest.php b/tests/unit/Espo/Core/Upgrades/Actions/BaseTest.phpindex 8f378f2a1b..bdd29bfe8f 100644--- a/tests/unit/Espo/Core/Upgrades/Actions/BaseTest.php+++ b/tests/unit/Espo/Core/Upgrades/Actions/BaseTest.php@@ -126,7 +126,7 @@ class BaseTest extends TestCase$this->reflection->setProperty('processId', 'ngkdf54n566n45');/* create a package directory with manifest.json file */- $packagePath = $this->reflection->invokeMethod('getPath');+ $packagePath = $this->reflection->invokeMethod('getPath', ['packagePath']);$manifestName = $this->reflection->getProperty('manifestName');$filename = $packagePath . '/' .$manifestName;@@ -143,7 +143,7 @@ class BaseTest extends TestCase$processId = $this->reflection->getProperty('processId');if (isset($processId)) {- $packagePath = $this->reflection->invokeMethod('getPath');+ $packagePath = $this->reflection->invokeMethod('getPath', ['packagePath']);$this->fileManagerOriginal->removeInDir($packagePath, true);}@@ -281,13 +281,13 @@ class BaseTest extends TestCase$this->assertTrue($this->reflection->invokeMethod('isAcceptable') );}- public function testGetPath()+ public function testGetPath(): void{$packageId = $this->reflection->invokeMethod('getProcessId');$packagePath = Util::fixPath($this->actionManagerParams['packagePath'] . '/' . $packageId);- $this->assertEquals($packagePath, $this->reflection->invokeMethod('getPath') );- $this->assertEquals($packagePath, $this->reflection->invokeMethod('getPath', ['packagePath']) );+ $this->assertEquals($packagePath, $this->reflection->invokeMethod('getPath', ['packagePath']));+ $this->assertEquals($packagePath, $this->reflection->invokeMethod('getPath', ['packagePath']));$postfix = 'z';$this->assertEquals($packagePath.$postfix, $this->reflection->invokeMethod('getPath', ['packagePath', true]));