diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 8c987dd35..4080a053d 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -6,6 +6,7 @@ - fixed: #10262: Default Inbox View Template: Mismatch in HTML for upper and lower page navigation - fixed rfe #10474: Improve error message for template errors - removed hardcoding of administer.js and survey.css hardcoded extras paths. + - fixed Error message when you try to send a message from the Inbox, but none of your friends allow private messaging. 7.7.9 - fixed #10266: Public Profile overrides Able to be friend diff --git a/lib/WebGUI/Account/Inbox.pm b/lib/WebGUI/Account/Inbox.pm index ccce0410c..6aa43a243 100644 --- a/lib/WebGUI/Account/Inbox.pm +++ b/lib/WebGUI/Account/Inbox.pm @@ -1129,7 +1129,8 @@ sub www_sendMessage { my $activeFriendCount = 0; #Append this users friends to the template my @friendsLoop = (); - foreach my $friendId (keys %{$friends}) { + my @friendIds = keys %{ $friends }; + foreach my $friendId (@friendIds) { my $friend = WebGUI::User->new($session,$friendId); #This friend has private messages turned off my $disabled = "disabled"; @@ -1162,13 +1163,21 @@ sub www_sendMessage { } #You can't send new messages if you don't have any friends to send to - unless($activeFriendCount) { + unless(@friendIds) { my $i18n = WebGUI::International->new($session,'Account_Inbox'); $errorMsg = $i18n->get("no friends error"); $var->{'isInbox'} = "true"; return $self->showError($var,$errorMsg,$backUrl,$self->getInboxErrorTemplateId); } + #You can't send new messages if you don't have any friends to send to + unless($activeFriendCount) { + my $i18n = WebGUI::International->new($session,'Account_Inbox'); + $errorMsg = $i18n->get("no messagable friends error"); + $var->{'isInbox'} = "true"; + return $self->showError($var,$errorMsg,$backUrl,$self->getInboxErrorTemplateId); + } + $var->{'friends_loop' } = \@friendsLoop; $var->{'checked_fiends_loop'} = \@checkedFriends; } diff --git a/lib/WebGUI/i18n/English/Account_Inbox.pm b/lib/WebGUI/i18n/English/Account_Inbox.pm index a9a9a2351..7bbb855c8 100644 --- a/lib/WebGUI/i18n/English/Account_Inbox.pm +++ b/lib/WebGUI/i18n/English/Account_Inbox.pm @@ -340,6 +340,11 @@ our $I18N = { lastUpdated => 1181019679, }, + 'no messagable friends error' => { + message => q{None of your friends allow private messaging.}, + lastUpdated => 1244494607, + }, + 'no friends hover' => { message => q{You must have active friends in the system if you wish to send new private messages without having to first locate their profile}, lastUpdated => 1181019679,