Forum

Notifications are g...
 
Notifications
Retirer tout

Notifications are going to the wrong person

3 Posts
2 Utilisateurs
0 Reactions
1,692 Vu
(@burgerzs)
Posts: 24
Active Member
Début du sujet
 
[#6314]

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;}
}


 
Posté : 23 Oct PM 19:1010
(@babynus)
Posts: 14952
Membre Admin
 

Hi,

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.


 
Posté : 24 Oct PM 12:1010
(@burgerzs)
Posts: 24
Active Member
Début du sujet
 

Hi,

Thanks, it is ok now.

Regards,
Zsolt


 
Posté : 29 Oct PM 18:1010
Share:
Retour en haut