Skip to content

Commit bfc0a55

Browse files
authored
Merge pull request #14026 from nextcloud/backport/13954/stable15
[stable15] Show original path in trashbin
2 parents 52f0633 + cba2c1f commit bfc0a55

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

apps/files_trashbin/js/filelist.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
var DELETED_REGEXP = new RegExp(/^(.+)\.d[0-9]+$/);
1212
var FILENAME_PROP = '{http://nextcloud.org/ns}trashbin-filename';
1313
var DELETION_TIME_PROP = '{http://nextcloud.org/ns}trashbin-deletion-time';
14+
var TRASHBIN_ORIGINAL_LOCATION = '{http://nextcloud.org/ns}trashbin-original-location';
1415

1516
/**
1617
* Convert a file name in the format filename.d12345 to the real file name.
@@ -54,11 +55,13 @@
5455
initialize: function() {
5556
this.client.addFileInfoParser(function(response, data) {
5657
var props = response.propStat[0].properties;
58+
var path = props[TRASHBIN_ORIGINAL_LOCATION];
5759
return {
5860
displayName: props[FILENAME_PROP],
5961
mtime: parseInt(props[DELETION_TIME_PROP], 10) * 1000,
6062
hasPreview: true,
61-
path: data.path.substr(6), // remove leading /trash
63+
path: path,
64+
extraData: path
6265
}
6366
});
6467

@@ -248,7 +251,7 @@
248251
* Returns list of webdav properties to request
249252
*/
250253
_getWebdavProperties: function() {
251-
return [FILENAME_PROP, DELETION_TIME_PROP].concat(this.filesClient.getPropfindProperties());
254+
return [FILENAME_PROP, DELETION_TIME_PROP, TRASHBIN_ORIGINAL_LOCATION].concat(this.filesClient.getPropfindProperties());
252255
},
253256

254257
/**

0 commit comments

Comments
 (0)