Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

Notifications are g...
 
Notifications
Clear all

Notifications are going to the wrong person

3 Posts
2 Users
0 Reactions
1,723 Views
(@burgerzs)
Posts: 24
Active Member
Topic starter
 
[#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;}
}


 
Posted : 23 Oct 2019 19H30
babynus
(@babynus)
Posts: 14966
Main Contributor 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.


 
Posted : 24 Oct 2019 12H56
(@burgerzs)
Posts: 24
Active Member
Topic starter
 

Hi,

Thanks, it is ok now.

Regards,
Zsolt


 
Posted : 29 Oct 2019 18H50
Share:

Scroll to Top