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
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
Comment #3
andreasderijckeMerge request submitted.
Comment #4
andreasderijckeComment #7
davisbenMerged. Thanks for the MR!