From 05202544f14a85772df55f6fc7d7037ca8c295e2 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 20 Oct 2020 15:50:30 +0100 Subject: [PATCH] Bug 24370: (follow-up) Allow resetting library to ANY This patch updates ModSuggestion to reset branchcode to null if passed an empty string. --- C4/Suggestions.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index 11cbf96fb7..2d0e985510 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -471,6 +471,7 @@ sub ModSuggestion { return unless( $suggestion and defined($suggestion->{suggestionid}) ); my $suggestion_object = Koha::Suggestions->find( $suggestion->{suggestionid} ); + $suggestion->{branchcode} = undef if ( exists( $suggestion->{branchcode} ) && $suggestion->{branchcode} eq "" ); eval { # FIXME Must raise an exception instead $suggestion_object->set($suggestion)->store; }; -- 2.20.1