Skip to content

Commit

Permalink
Fixed bugs with restoring volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
timmyomahony committed Dec 11, 2020
1 parent 2c04ed3 commit 1692e00
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"description": "Backend module for remote-sync and remote-backup",
"type": "craft-module",
"license": "proprietary",
"version": "1.4.0",
"authors": [
{
"name": "Timmy O'Mahony",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/RemoteCoreUtility/dist/js/RemoteCoreUtility.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
this.addListener(
$row.find(".delete-button"),
"click",
this.delete.bind(this, options[i].value)
this.delete.bind(this, options[i].filename)
);
}

Expand Down
3 changes: 2 additions & 1 deletion src/helpers/RemoteFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public static function toHTMLOptions($array, $format="Y-m-d H:i:s") {
$text = $file->datetime->format($format);
$options[$i] = [
"text" => $text,
"title" => $title
"title" => $title,
"filename" => $file->filename
];
}
return $options;
Expand Down
3 changes: 2 additions & 1 deletion src/services/ProviderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,9 @@ private function restoreVolumesZip($zipPath)
$absDir = $tmpDir . DIRECTORY_SEPARATOR . $dir;
$files = FileHelper::findFiles($absDir);
foreach ($files as $file) {
Craft::debug("-- " . $file, "remote-core");
if (is_file($file)) {
$relPath = str_replace($tmpDir . DIRECTORY_SEPARATOR, '', $file);
$relPath = str_replace($tmpDir . DIRECTORY_SEPARATOR . $volume->handle, '', $file);
$stream = fopen($file, 'r');
if ($volume->fileExists($relPath)) {
$volume->updateFileByStream($relPath, $stream, []);
Expand Down

0 comments on commit 1692e00

Please sign in to comment.