From 1e439d710517b291b5a065200ef20a3fdf798de2 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 27 Jun 2022 13:23:06 -0300 Subject: [PATCH] Bug 23991: (follow-up) Silence useless warnings Signed-off-by: Tomas Cohen Arazi --- C4/Suggestions.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index 2d30913f0b..dc92c1554f 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -249,7 +249,8 @@ sub NewSuggestion { $suggestion->{suggesteddate} = dt_from_string unless $suggestion->{suggesteddate}; - delete $suggestion->{branchcode} if $suggestion->{branchcode} eq ''; + delete $suggestion->{branchcode} + if defined $suggestion->{branchcode} and $suggestion->{branchcode} eq ''; my $suggestion_object = Koha::Suggestion->new( $suggestion )->store; my $suggestion_id = $suggestion_object->suggestionid; @@ -403,7 +404,9 @@ sub DelSuggestion { my $sth = $dbh->prepare($query); $sth->execute($suggestionid); my ($suggestedby) = $sth->fetchrow; - if ( $type eq 'intranet' || $suggestedby eq $borrowernumber ) { + $suggestedby //= ''; + $borrowernumber //= ''; + if ( defined $type && $type eq 'intranet' || $suggestedby eq $borrowernumber ) { my $queryDelete = q{ DELETE FROM suggestions WHERE suggestionid=? -- 2.39.5