diff options
author | Pauli Järvinen <pauli.jarvinen@gmail.com> | 2017-07-16 12:49:46 +0300 |
---|---|---|
committer | Pauli Järvinen <pauli.jarvinen@gmail.com> | 2017-07-16 13:13:15 +0300 |
commit | 8dce97a3e17a42ce734d5ca10899a08b96721f18 (patch) | |
tree | f463ca1e4f6393854e7b7f5d693165ace7535fe8 | |
parent | a23cdd04bb3ba3ff9e6313ae92b01d4fc0c1167c (diff) | |
download | nextcloud-server-8dce97a3e17a42ce734d5ca10899a08b96721f18.tar.gz nextcloud-server-8dce97a3e17a42ce734d5ca10899a08b96721f18.zip |
Fix emitting of legacy hook post_unshare
- 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>
-rw-r--r-- | lib/private/Share20/LegacyHooks.php | 2 | ||||
-rw-r--r-- | tests/lib/Share20/LegacyHooksTest.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/Share20/LegacyHooks.php b/lib/private/Share20/LegacyHooks.php index 728ea78a8a6..09acf6c50e7 100644 --- a/lib/private/Share20/LegacyHooks.php +++ b/lib/private/Share20/LegacyHooks.php @@ -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) { diff --git a/tests/lib/Share20/LegacyHooksTest.php b/tests/lib/Share20/LegacyHooksTest.php index d3a538f1d8d..75a77306116 100644 --- a/tests/lib/Share20/LegacyHooksTest.php +++ b/tests/lib/Share20/LegacyHooksTest.php @@ -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, |