Browse Source

Bug 24244: Send null instead of empty string if branch not set

Fix NewSuggestion if branchcode is passed with an empty string.
Error was "Broken FK constraint"

Test plan:
Create a new suggestion, select "any" for the library.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
20.05.x
Nick Clemens 4 years ago
committed by Martin Renvoize
parent
commit
ee4d99cc76
Signed by: martin.renvoize GPG Key ID: 422B469130441A0F
  1. 2
      C4/Suggestions.pm

2
C4/Suggestions.pm

@ -448,6 +448,8 @@ sub NewSuggestion {
$suggestion->{suggesteddate} = dt_from_string unless $suggestion->{suggesteddate};
delete $suggestion->{branchcode} if $suggestion->{branchcode} eq '';
my $suggestion_object = Koha::Suggestion->new( $suggestion )->store;
my $suggestion_id = $suggestion_object->suggestionid;

Loading…
Cancel
Save