From 71589e65d24657a6d61fc22b3c67d5a1f5b1404a Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Fri, 29 Nov 2013 16:43:50 +0100 Subject: [PATCH] fix restore from files in sub-folders --- apps/files_trashbin/ajax/undelete.php | 1 + apps/files_trashbin/js/trash.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/files_trashbin/ajax/undelete.php b/apps/files_trashbin/ajax/undelete.php index e39004cc0d5..876ad269a70 100644 --- a/apps/files_trashbin/ajax/undelete.php +++ b/apps/files_trashbin/ajax/undelete.php @@ -13,6 +13,7 @@ $success = array(); $i = 0; foreach ($list as $file) { if ( $dirlisting === '0') { + $file = ltrim($file, '/'); $delimiter = strrpos($file, '.d'); $filename = substr($file, 0, $delimiter); $timestamp = substr($file, $delimiter+2); diff --git a/apps/files_trashbin/js/trash.js b/apps/files_trashbin/js/trash.js index 84c23d66992..2c1af34ccec 100644 --- a/apps/files_trashbin/js/trash.js +++ b/apps/files_trashbin/js/trash.js @@ -8,7 +8,7 @@ $(document).ready(function() { deleteAction.removeClass('delete-icon').addClass('progress-icon'); disableActions(); $.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'), - {files: JSON.stringify([filename]), dirlisting: tr.attr('data-dirlisting')}, + {files: JSON.stringify([$('#dir').val() + '/' + filename]), dirlisting: tr.attr('data-dirlisting')}, function(result) { for (var i = 0; i < result.data.success.length; i++) { var row = document.getElementById(result.data.success[i].filename); @@ -229,7 +229,7 @@ function getSelectedFiles(property){ elements.each(function(i,element){ var file={ name:$(element).attr('data-filename'), - file:$(element).attr('data-file'), + file:$('#dir').val() + "/" + $(element).attr('data-file'), timestamp:$(element).attr('data-timestamp'), type:$(element).attr('data-type'), dirlisting:$(element).attr('data-dirlisting') -- 2.39.5