Bug 22907: Remove previous code handling the same thing
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 14 May 2019 17:27:25 +0000 (12:27 -0500)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 30 May 2019 20:36:36 +0000 (21:36 +0100)
See:
  commit a71b96295fb07084e4f87ac1a471e89355f3c5a4
  Bug 12627: Fix default values

Signed-off-by: Liz Rea <wizzyrea@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 8fed07826ee9fd69f3b92bbb6decb864e4c7dfd2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

C4/Suggestions.pm

index 35d72ea..75006ac 100644 (file)
@@ -435,20 +435,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};
@@ -474,23 +460,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;