aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib/storage.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-03-18 19:22:15 +0100
committerVincent Petry <pvince81@owncloud.com>2015-03-18 19:56:31 +0100
commita9e6eba018eb8cbd552fef51380cbbfff8c29783 (patch)
tree8e114e7fdd642d803aca6d38cecb229a911882ee /apps/files_trashbin/lib/storage.php
parentc2315aa0159628618d58458c1fb4d40287645a06 (diff)
downloadnextcloud-server-a9e6eba018eb8cbd552fef51380cbbfff8c29783.tar.gz
nextcloud-server-a9e6eba018eb8cbd552fef51380cbbfff8c29783.zip
Reenable trashbin after failed rename
After a failed rename, the post_rename hook is not called. This quickfix makes sure the trashbin storage logic is reenabled also after a failed rename.
Diffstat (limited to 'apps/files_trashbin/lib/storage.php')
-rw-r--r--apps/files_trashbin/lib/storage.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/storage.php b/apps/files_trashbin/lib/storage.php
index 175889ef95d..d15b136924c 100644
--- a/apps/files_trashbin/lib/storage.php
+++ b/apps/files_trashbin/lib/storage.php
@@ -62,6 +62,22 @@ class Storage extends Wrapper {
}
/**
+ * Rename path1 to path2 by calling the wrapped storage.
+ *
+ * @param string $path1 first path
+ * @param string $path2 second path
+ */
+ public function rename($path1, $path2) {
+ $result = $this->storage->rename($path1, $path2);
+ if ($result === false) {
+ // when rename failed, the post_rename hook isn't triggered,
+ // but we still want to reenable the trash logic
+ self::$disableTrash = false;
+ }
+ return $result;
+ }
+
+ /**
* Deletes the given file by moving it into the trashbin.
*
* @param string $path