diff --git a/application/Espo/Core/Upgrades/Actions/Base.php b/application/Espo/Core/Upgrades/Actions/Base.php index f3b90f1f22..25667b46e1 100644 --- a/application/Espo/Core/Upgrades/Actions/Base.php +++ b/application/Espo/Core/Upgrades/Actions/Base.php @@ -61,6 +61,8 @@ abstract class Base protected $packagePostfix = 'z'; + protected $scriptParams = []; + /** * Directory name of files in a package */ @@ -291,7 +293,7 @@ abstract class Base $script = new $scriptName(); try { - $script->run($this->getContainer()); + $script->run($this->getContainer(), $this->scriptParams); } catch (\Exception $e) { $this->throwErrorAndRemovePackage($e->getMessage()); } diff --git a/application/Espo/Core/Upgrades/Actions/Extension/Install.php b/application/Espo/Core/Upgrades/Actions/Extension/Install.php index 0c9c86531c..c24b181717 100644 --- a/application/Espo/Core/Upgrades/Actions/Extension/Install.php +++ b/application/Espo/Core/Upgrades/Actions/Extension/Install.php @@ -39,6 +39,8 @@ class Install extends \Espo\Core\Upgrades\Actions\Base\Install { $this->findExtension(); if (!$this->isNew()) { + $this->scriptParams['isUpgrade'] = true; + $this->compareVersion(); $this->uninstallExtension(); $this->deleteExtension();