diff --git a/src/Controller/CommentController.php b/src/Controller/CommentController.php index aba87fcdd..c35e72292 100644 --- a/src/Controller/CommentController.php +++ b/src/Controller/CommentController.php @@ -61,7 +61,9 @@ public function reportCommentAction( $member = $this->getUser(); if ($member !== $toMember) { - throw new AccessDeniedException(); + $this->addTranslatedFlash('notice', 'flash.comment.report.only.own'); + + return $this->redirectToRoute('profile_comments', ['username' => $member->getUsername()]); } $commentRepository = $entityManager->getRepository(Comment::class); diff --git a/translations/missing/comment.yaml b/translations/missing/comment.yaml index 0f59449f7..34adc98dd 100644 --- a/translations/missing/comment.yaml +++ b/translations/missing/comment.yaml @@ -79,3 +79,6 @@ comment.reminder.host.body:

We hope your experience was pleasant and enriching, and that your comment will help other members experience the same. But in case there were serious problems, please do share them, too. You can also share information confidentially with the Safety Team using the “Report profile” link on the profile of {profile_start}{host}{profile_end}.

The BeWelcome volunteers.

" - Text of the comment reminder send to the host if the guest doesn't leave a comment (send three weeks after the end of the requested stay). Pay special attention to the start and end variables for the links. +flash.comment.report.only.own: + - Can't report comments of other members. + - Flash message shown if you followed a wrong link to report a comment.