]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix emitting of legacy hook post_unshare 5784/head
authorPauli Järvinen <pauli.jarvinen@gmail.com>
Sun, 16 Jul 2017 09:49:46 +0000 (12:49 +0300)
committerMorris Jobke <hey@morrisjobke.de>
Wed, 19 Jul 2017 09:42:23 +0000 (11:42 +0200)
- When a file was unshared, the legacy hook pre_unshare fired twice and the hook post_unshare did not fire at all. This was obviously a copy-paste error.

Signed-off-by: Pauli Järvinen <pauli.jarvinen@gmail.com>
lib/private/Share20/LegacyHooks.php
tests/lib/Share20/LegacyHooksTest.php

index 728ea78a8a6c37a1ecea73891c590795884c6bbe..09acf6c50e782a04d8c62795ddc0f253761b4af7 100644 (file)
@@ -71,7 +71,7 @@ class LegacyHooks {
 
                $formatted['deletedShares'] = $formattedDeletedShares;
 
-               \OC_Hook::emit('OCP\Share', 'pre_unshare', $formatted);
+               \OC_Hook::emit('OCP\Share', 'post_unshare', $formatted);
        }
 
        private function formatHookParams(IShare $share) {
index d3a538f1d8d95991de19aa72c022d1807b231022..75a773061166efed93dd87d56ff7786fdfdb9624 100644 (file)
@@ -99,7 +99,7 @@ class LegacyHooksTest extends TestCase {
                        ->setTarget('myTarget');
 
                $hookListner = $this->getMockBuilder('Dummy')->setMethods(['post'])->getMock();
-               \OCP\Util::connectHook('OCP\Share', 'pre_unshare', $hookListner, 'post');
+               \OCP\Util::connectHook('OCP\Share', 'post_unshare', $hookListner, 'post');
 
                $hookListnerExpectsPost = [
                        'id' => 42,