🐛 fix bug on participant deletion

This commit is contained in:
Marc Koch 2025-04-01 18:53:32 +02:00
parent c748847442
commit 773cf827a3
Signed by: marc.koch
GPG key ID: 12406554CFB028B9

View file

@ -225,8 +225,10 @@ function mailinglistsync_civicrm_post(string $op, string $objectName, int $objec
->first()['event_id']; ->first()['event_id'];
$mailingList = new EventMailingList($eventId); $mailingList = new EventMailingList($eventId);
// Check permission to alter event mailing list // Check permission to alter event mailing list if it is not a deletion
if ($mailingList->isEnabled() && !CRM_Core_Permission::check('manage_event_mailinglists')) { if ($op !== 'delete'
&& $mailingList->isEnabled()
&& !CRM_Core_Permission::check('manage_event_mailinglists')) {
CRM_Core_Session::setStatus( CRM_Core_Session::setStatus(
E::ts('You do not have permission to manage event mailing lists.'), E::ts('You do not have permission to manage event mailing lists.'),
E::ts('Permission Denied'), E::ts('Permission Denied'),