Skip to content

Commit 91bc5cc

Browse files
committed
MAGETWO-88345: Cannot upgrade CE to EE with staging
1 parent 6edd0cf commit 91bc5cc

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

setup/src/Magento/Setup/Model/Installer.php

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,7 @@ public function __construct(
321321
$this->sampleDataState = $sampleDataState;
322322
$this->componentRegistrar = $componentRegistrar;
323323
$this->phpReadinessCheck = $phpReadinessCheck;
324-
$this->declarationInstaller = $declarationInstaller ?: $this->objectManagerProvider->get()->get(
325-
DeclarationInstaller::class
326-
);
324+
327325
$this->schemaPersistor = $this->objectManagerProvider->get()->get(SchemaPersistor::class);
328326
}
329327

@@ -385,6 +383,21 @@ public function install($request)
385383
}
386384
}
387385

386+
/**
387+
* Get declaration installer. For upgrade process it must be created after deployment config update.
388+
*
389+
* @return DeclarationInstaller
390+
*/
391+
private function getDeclarationInstaller()
392+
{
393+
if (!$this->declarationInstaller) {
394+
$this->declarationInstaller = $this->objectManagerProvider->get()->get(
395+
DeclarationInstaller::class
396+
);
397+
}
398+
return $this->declarationInstaller;
399+
}
400+
388401
/**
389402
* Writes installation date to the configuration
390403
*
@@ -794,7 +807,7 @@ private function setupFlagTable(
794807
*/
795808
public function declarativeInstallSchema(array $request)
796809
{
797-
$this->declarationInstaller->installSchema($request);
810+
$this->getDeclarationInstaller()->installSchema($request);
798811
}
799812

800813
/**

0 commit comments

Comments
 (0)