From 038def23286ac685e4a0a5f259d2d5e0b69a8b96 Mon Sep 17 00:00:00 2001 From: Samuel Date: Fri, 5 Feb 2021 12:06:35 +0100 Subject: [PATCH 1/3] fix(translation): replace static error message as suggested by @kesselb in nextcloud/server#25490 Signed-off-by: Samuel --- lib/private/Share20/Manager.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 35374fd167..bd0d51486a 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -542,7 +542,8 @@ class Manager implements IManager { $this->groupManager->getUserGroupIds($sharedWith) ); if (empty($groups)) { - throw new \Exception('Sharing is only allowed with group members'); + $message_t = $this->l->t('Sharing is only allowed with group members'); + throw new GenericShareException($message_t, $message_t, 404); } } From d494c6650c83ceac00ff53e94c121b037d406dd0 Mon Sep 17 00:00:00 2001 From: Samuel Date: Fri, 5 Feb 2021 12:52:59 +0100 Subject: [PATCH 2/3] revert(exception): keep throwing an exception for now Signed-off-by: Samuel --- lib/private/Share20/Manager.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index bd0d51486a..61f6d87336 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -543,7 +543,8 @@ class Manager implements IManager { ); if (empty($groups)) { $message_t = $this->l->t('Sharing is only allowed with group members'); - throw new GenericShareException($message_t, $message_t, 404); + // throw new GenericShareException($message_t, $message_t, 404); + throw new \Exception($message_t); } } From 09f16281a2e8f210505d76a58cfc1068605a707d Mon Sep 17 00:00:00 2001 From: Samuel Date: Fri, 5 Feb 2021 13:27:37 +0100 Subject: [PATCH 3/3] revert(comment) Signed-off-by: Samuel --- lib/private/Share20/Manager.php | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php index 61f6d87336..0f70948201 100644 --- a/lib/private/Share20/Manager.php +++ b/lib/private/Share20/Manager.php @@ -543,7 +543,6 @@ class Manager implements IManager { ); if (empty($groups)) { $message_t = $this->l->t('Sharing is only allowed with group members'); - // throw new GenericShareException($message_t, $message_t, 404); throw new \Exception($message_t); } }