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>
This commit is contained in:
parent
611cb46189
commit
ee4d99cc76
|
|
@ -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…
Reference in New Issue