From 8fed07826ee9fd69f3b92bbb6decb864e4c7dfd2 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 14 May 2019 12:27:25 -0500 Subject: [PATCH] Bug 22907: Remove previous code handling the same thing See: commit a71b96295fb07084e4f87ac1a471e89355f3c5a4 Bug 12627: Fix default values Signed-off-by: Liz Rea Signed-off-by: Marcel de Rooy Signed-off-by: Nick Clemens --- C4/Suggestions.pm | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index 495d380e87..3367df5848 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -437,20 +437,6 @@ Insert a new suggestion on database with value given on input arg. sub NewSuggestion { my ($suggestion) = @_; - for my $field ( qw( - suggestedby - managedby - manageddate - acceptedby - accepteddate - rejectedby - rejecteddate - budgetid - ) ) { - # Set the fields to NULL if not given. - $suggestion->{$field} ||= undef; - } - $suggestion->{STATUS} = "ASKED" unless $suggestion->{STATUS}; $suggestion->{suggesteddate} = dt_from_string unless $suggestion->{suggesteddate}; @@ -526,23 +512,6 @@ sub ModSuggestion { my ($suggestion) = @_; return unless( $suggestion and defined($suggestion->{suggestionid}) ); - for my $field ( qw( - suggestedby - managedby - manageddate - acceptedby - accepteddate - rejectedby - rejecteddate - budgetid - ) ) { - # Set the fields to NULL if not given. - $suggestion->{$field} = undef - if exists $suggestion->{$field} - and ($suggestion->{$field} eq '0' - or $suggestion->{$field} eq '' ); - } - my $suggestion_object = Koha::Suggestions->find( $suggestion->{suggestionid} ); eval { # FIXME Must raise an exception instead $suggestion_object->set($suggestion)->store; -- 2.20.1