Skip to content

Commit e3b8b3b

Browse files
committed
Fix setup upgrade command re enables caches
Fix static test failure
1 parent 46c60ea commit e3b8b3b

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

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

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ private function throwExceptionForNotWritablePaths(array $paths)
10121012
*/
10131013
private function handleDBSchemaData($setup, $type, array $request)
10141014
{
1015-
if (!($type === 'schema' || $type === 'data')) {
1015+
if ($type !== 'schema' && $type !== 'data') {
10161016
// phpcs:ignore Magento2.Exceptions.DirectThrow
10171017
throw new Exception("Unsupported operation type $type is requested");
10181018
}
@@ -1031,17 +1031,13 @@ private function handleDBSchemaData($setup, $type, array $request)
10311031
'objectManager' => $this->objectManagerProvider->get()
10321032
]
10331033
);
1034+
1035+
$patchApplierParams = $type === 'schema' ?
1036+
['schemaSetup' => $setup] :
1037+
['moduleDataSetup' => $setup, 'objectManager' => $this->objectManagerProvider->get()];
1038+
10341039
/** @var PatchApplier $patchApplier */
1035-
if ($type === 'schema') {
1036-
$patchApplier = $this->patchApplierFactory->create(['schemaSetup' => $setup]);
1037-
} elseif ($type === 'data') {
1038-
$patchApplier = $this->patchApplierFactory->create(
1039-
[
1040-
'moduleDataSetup' => $setup,
1041-
'objectManager' => $this->objectManagerProvider->get()
1042-
]
1043-
);
1044-
}
1040+
$patchApplier = $this->patchApplierFactory->create($patchApplierParams);
10451041

10461042
foreach ($moduleNames as $moduleName) {
10471043
if ($this->isDryRun($request)) {
@@ -1103,11 +1099,11 @@ private function handleDBSchemaData($setup, $type, array $request)
11031099

11041100
if ($type === 'schema') {
11051101
$this->log->log('Schema post-updates:');
1106-
$handlerType = 'schema-recurring';
11071102
} elseif ($type === 'data') {
11081103
$this->log->log('Data post-updates:');
1109-
$handlerType = 'data-recurring';
11101104
}
1105+
$handlerType = $type === 'schema' ? 'schema-recurring' : 'data-recurring';
1106+
11111107
foreach ($moduleNames as $moduleName) {
11121108
if ($this->isDryRun($request)) {
11131109
$this->log->log("Module '{$moduleName}':");
@@ -1745,6 +1741,8 @@ public function removeUnusedTriggers(): void
17451741
}
17461742

17471743
/**
1744+
* Returns list of disabled cache types
1745+
*
17481746
* @param array $cacheTypesToCheck
17491747
* @return array
17501748
*/
@@ -1761,7 +1759,7 @@ private function getDisabledCacheTypes(array $cacheTypesToCheck): array
17611759
$disabledCaches[] = $cacheType;
17621760
}
17631761
}
1764-
1762+
17651763
return $disabledCaches;
17661764
}
17671765
}

0 commit comments

Comments
 (0)