Problem/Motivation

When you add a Message (in the backend) to a group of which the current User is not a member of, a php exception is thrown causing a fatal error.

Steps to reproduce

  • Make sure to be logged in with a User able to manage Mail Groups
  • Make sure you have a Mail Group the User isn not a member of
  • Create a Message for the Mail Group

Proposed resolution

Perform the checks in \Drupal\mailgroup\Entity\MailGroupMessage::preSave also in the form validation of \Drupal\mailgroup\Entity\Form\MailGroupMessageForm, so the exceptions can be added as messages to the form and prevent actual form submission.

Issue fork mailgroup-3275649

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

andreasderijcke created an issue. See original summary.

andreasderijcke’s picture

Status: Active » Needs review

Merge request submitted.

andreasderijcke’s picture

Issue summary: View changes

davisben made their first commit to this issue’s fork.

davisben’s picture

Status: Needs review » Fixed

Merged. Thanks for the MR!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.