]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixed sharing hook to not remove the share before the trashbin
authorVincent Petry <pvince81@owncloud.com>
Wed, 27 Nov 2013 16:22:48 +0000 (17:22 +0100)
committerVincent Petry <pvince81@owncloud.com>
Wed, 27 Nov 2013 16:22:48 +0000 (17:22 +0100)
Fixed the hook order between sharing app and trashbin

apps/files_sharing/appinfo/app.php
apps/files_sharing/lib/updater.php

index bdaea64bb90bf326b6c0545a8f216228e7380e20..217bc005faf3d9fb61caa336e4d7b330084cfd4c 100644 (file)
@@ -14,6 +14,7 @@ OCP\Share::registerBackend('file', 'OC_Share_Backend_File');
 OCP\Share::registerBackend('folder', 'OC_Share_Backend_Folder', 'file');
 OCP\Util::addScript('files_sharing', 'share');
 \OC_Hook::connect('OC_Filesystem', 'post_write', '\OC\Files\Cache\Shared_Updater', 'writeHook');
+\OC_Hook::connect('OC_Filesystem', 'post_delete', '\OC\Files\Cache\Shared_Updater', 'postDeleteHook');
 \OC_Hook::connect('OC_Filesystem', 'delete', '\OC\Files\Cache\Shared_Updater', 'deleteHook');
 \OC_Hook::connect('OC_Filesystem', 'post_rename', '\OC\Files\Cache\Shared_Updater', 'renameHook');
 \OC_Hook::connect('OCP\Share', 'post_shared', '\OC\Files\Cache\Shared_Updater', 'shareHook');
index 171999ea6523e141b7d6e9eac3269a15216bd5ee..0c35b18c42be3b89df37dbd1ccef8ca760337ae7 100644 (file)
@@ -89,9 +89,14 @@ class Shared_Updater {
         */
        static public function deleteHook($params) {
                self::correctFolders($params['path']);
-               self::removeShare($params['path']);
        }
 
+       /**
+        * @param array $params
+        */
+       static public function postDeleteHook($params) {
+               self::removeShare($params['path']);
+       }
 
        /**
         * @param array $params