Bug 23991: (follow-up) Silence useless warnings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Tomas Cohen Arazi 2022-06-27 13:23:06 -03:00
parent 148e93d45d
commit 1e439d7105
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 5 additions and 2 deletions

View File

@ -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=?