From fb3c85fdd2cd24e179843e8c361993e0d964a830 Mon Sep 17 00:00:00 2001 From: Stephen Opal Date: Thu, 29 Jan 2009 17:36:36 +0000 Subject: [PATCH] When using only a groupId in create, the code assumed that the call also intended to use a userId, which it acquired from $session->user->userId. This caused group type administrative notices to also go to the initial user. --- lib/WebGUI/Inbox/Message.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Inbox/Message.pm b/lib/WebGUI/Inbox/Message.pm index 5ff02f95e..0e9ea9280 100644 --- a/lib/WebGUI/Inbox/Message.pm +++ b/lib/WebGUI/Inbox/Message.pm @@ -109,10 +109,12 @@ sub create { $self->{_properties}{subject} = $properties->{subject} || WebGUI::International->new($session)->get(523); $self->{_properties}{message} = $properties->{message}; $self->{_properties}{dateStamp} = time(); - $self->{_properties}{userId} = $properties->{userId} || $session->user->userId; + $self->{_properties}{userId} = $properties->{userId}; $self->{_properties}{groupId} = $properties->{groupId}; $self->{_properties}{sentBy} = $properties->{sentBy} || 3; - + unless ( $self->{_properties}{userId} || $self->{_properties}{groupId} ) { + $self->{_properties}{userId} = $session->user->userId; + } my $status = $self->{_properties}{status}; if ($status eq "completed") {