[Pkg-owncloud-commits] [owncloud] 100/118: Reenable trashbin after failed rename
David Prévot
taffit at moszumanska.debian.org
Fri Mar 27 22:13:18 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch stable8
in repository owncloud.
commit 3b69354d1918ec5968e7152366ed897104253123
Author: Vincent Petry <pvince81 at owncloud.com>
Date: Wed Mar 18 19:22:15 2015 +0100
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.
---
apps/files_trashbin/lib/storage.php | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/apps/files_trashbin/lib/storage.php b/apps/files_trashbin/lib/storage.php
index 175889e..d15b136 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
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list