In version 8.2.2 notifications are sent to the wrong person.
In Notification.php in the save function if it is a new notification, then it overwrites the idUser that is set in NotificationDefinition.php.
I changed this part as follows, if idUser and IdResource is set, then it won't overwrite:
if (is_null($this->id)) {
// Inits the status to unread
$this->idStatusNotification = 1;
// Inits creationDate with today
$this->creationDateTime=date('Y-m-d H:i:s');
// idUser is in fact the receiver
if (is_null($this->idUser)){$this->idUser = $this->idResource;}
// idResource = connected user ==> $userId
if (is_null($this->idResource)){$this->idResource = $userId;}
}
Thanks for posting the issue and proposing patch.*
There was a little specific case that your fix did not take into account.
Whan direcly creating a notification (not from definition), notification was send to sended instead of receiver.
This was the reason of this strange change of idUser.
Fix is ready for V8.2.3 and works on both cases.
En poursuivant votre navigation, vous acceptez le dépôt de cookies tiers destinés au bon fonctionnement et à la sécurisation du site (gestion de session, reCaptcha) et à une analyse statistique anonymisée des accès sur notre site (Google Analytics). Si vous vous inscrivez, les informations que vous fournirez ne seront jamais divulguées à un tiers sous quelque forme que ce soit. En savoir plus
Cookies settings
×
Functional Cookies
Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.
Session
Please login to see yours activities!
Other cookies
Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.