Skip to content

Commit 43db982

Browse files
safwkhaneddielau
authored andcommitted
MAGETWO-38151: Data Rollback
- Fixed the issue found in QA.
1 parent ac8ad60 commit 43db982

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/internal/Magento/Framework/Setup/BackupRollback.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,16 @@ public function codeRollback($rollbackFile, $type = Factory::TYPE_FILESYSTEM)
134134
if (!$this->file->isExists($backupsDir . '/' . $rollbackFile)) {
135135
throw new LocalizedException(new Phrase('The rollback file does not exist.'));
136136
}
137+
/** @var \Magento\Framework\Backup\Filesystem $fsRollback */
138+
$fsRollback = $this->objectManager->create('Magento\Framework\Backup\Filesystem');
137139
if ($type === Factory::TYPE_FILESYSTEM) {
138140
$ignorePaths = $this->getCodeBackupIgnorePaths();
139141
$granularType = 'Code';
142+
$fsRollback->setName('code');
140143
} elseif ($type === Factory::TYPE_MEDIA) {
141144
$ignorePaths = $this->getMediaBackupIgnorePaths();
142145
$granularType = 'Media';
146+
$fsRollback->setName('media');
143147
} else {
144148
throw new LocalizedException(new Phrase("This backup type \'$type\' is not supported."));
145149
}
@@ -155,8 +159,6 @@ public function codeRollback($rollbackFile, $type = Factory::TYPE_FILESYSTEM)
155159
new Phrase('Unable to make rollback because not all files are writable')
156160
);
157161
}
158-
/** @var \Magento\Framework\Backup\Filesystem $fsRollback */
159-
$fsRollback = $this->objectManager->create('Magento\Framework\Backup\Filesystem');
160162
$fsRollback->setRootDir($this->directoryList->getRoot());
161163
$fsRollback->addIgnorePaths($ignorePaths);
162164
$fsRollback->setBackupsDir($backupsDir);

0 commit comments

Comments
 (0)