Closed cristalink closed 1 year ago
Simple test at Online Perl Compiler:
sub ReturnSquare { return []; }
sub ReturnRound { return (); }
my @square = ReturnSquare;
my $square = @square;
my @round = ReturnRound;
my $round = @round;
print "ReturnSquare = " . \@square . ", [0] = " . @square[0] . ", count = " . $square . "\n";
print "ReturnRound = " . \@round . ", count = " . $round . "\n";
Result:
ReturnSquare = ARRAY(0x55bbe9141148), [0] = ARRAY(0x55bbe9118650), count = 1
ReturnRound = ARRAY(0x55bbe9141250), count = 0
Hi @cristalink, thanks for your report.
The analysis is absolutely correct as far as it goes. Many thanks for it. 👍🏼
I will write the code clearly and simply. This should prevent any misunderstandings.
sub GetTransportRecipients {
my ( $Self, %Param ) = @_;
my @TransportRecipients;
return @TransportRecipients;
}
The fix will come with the next release, soon.
Regards :rocket: Denny
Environment
Expected behaviour
Agents should receive emails notifications on ticket creation and update.
Actual behaviour
Emails are not sent and the following error is logged:
(in cleanup) Not a HASH reference at /opt/znuny-7.0.2/Kernel/System/TemplateGenerator.pm line 993.
Additional information
The problem seems to be with the newly added code in Kernel/System/Ticket/Event/NotificationEvent/Transport/Base.pm line 81:
The return value from Transport::Activity::GetTransportRecipients() is then used in this loop at Kernel/System/Ticket/Event/NotificationEvent.pm @346:
There seem to be a similar problem in Kernel/System/Calendar/Event/Transport/Base.pm line 79, but it isn't hit in my scenario.
I was able to fix the issue by using "return ()" instead of "return []".
There's a number of places in Znuny that use "return []". Perhaps they need to be reviewed as well.
Thanks.