From 22b29943ed8997a6167ddeb45f6cc63967c028f9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pauli=20J=C3=A4rvinen?= Date: Sun, 16 Jul 2017 12:49:46 +0300 Subject: [PATCH] Fix emitting of legacy hook post_unshare MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - 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 --- lib/private/Share20/LegacyHooks.php | 2 +- 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, -- 2.39.5