Skip to content

Commit

Permalink
AC-9027::get_class(): Argument #1 () must be of type object, string g…
Browse files Browse the repository at this point in the history
…iven in magento/framework/Setup/Patch/PatchApplier
  • Loading branch information
ashishkumarpundeer authored and ashishkumarpundeer committed Oct 5, 2023
1 parent 732c099 commit 397b759
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/internal/Magento/Framework/Setup/Patch/PatchApplier.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,22 +237,23 @@ public function applySchemaPatch($moduleName = null)
continue;
}
/**
* @var SchemaPatchInterface $schemaPatchObject
* @var SchemaPatchInterface $schemaPatch
*/
$schemaPatchObject = $this->patchFactory->create($schemaPatch, ['schemaSetup' => $this->schemaSetup]);
$schemaPatchObject->apply();
$this->patchHistory->fixPatch(get_class($schemaPatchObject));
foreach ($schemaPatchObject->getAliases() as $patchAlias) {
$schemaPatch = $this->patchFactory->create($schemaPatch, ['schemaSetup' => $this->schemaSetup]);
$schemaPatch->apply();
$this->patchHistory->fixPatch(get_class($schemaPatch));
foreach ($schemaPatch->getAliases() as $patchAlias) {
if (!$this->patchHistory->isApplied($patchAlias)) {
$this->patchHistory->fixPatch($patchAlias);
}
}
} catch (\Exception $e) {
$schemaPatchClass = is_object($schemaPatch) ? get_class($schemaPatch) : $schemaPatch;
throw new SetupException(
new Phrase(
'Unable to apply patch %1 for module %2. Original exception message: %3',
[
$schemaPatch,
$schemaPatchClass,
$moduleName,
$e->getMessage()
]
Expand Down

0 comments on commit 397b759

Please sign in to comment.