ProjeQtOr free project management software - Notifications are going to the wrong person - ProjeQtOr
 

Notifications are going to the wrong person

More
23 Oct 2019 17:30 - 23 Oct 2019 17:31 #1 by burgerzs
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;}
}
Last edit: 23 Oct 2019 17:31 by burgerzs.

Please Connexion or Create an account to join the conversation.

More
24 Oct 2019 10:56 #2 by babynus
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.

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

More
29 Oct 2019 16:50 - 29 Oct 2019 17:02 #3 by burgerzs
Hi,

Thanks, it is ok now.

Regards,
Zsolt
Last edit: 29 Oct 2019 17:02 by burgerzs.

Please Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.030 seconds