From 12c26a29076ecc5c97ac65048e41071efb1ae500 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 29 Sep 2014 15:18:31 +0200 Subject: [PATCH] [PASSED QA] Bug 12627: DBIx::Class is case sensitive for column names STATUS should be "STATUS", not "status". Signed-off-by: Katrin Fischer --- C4/Suggestions.pm | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index ddfa1b6..eae80a0 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -426,13 +426,10 @@ Insert a new suggestion on database with value given on input arg. sub NewSuggestion { my ($suggestion) = @_; - my $new_suggestion = { %$suggestion }; $suggestion->{STATUS} = "ASKED" unless $suggestion->{STATUS}; - $new_suggestion->{status} = $suggestion->{STATUS}; - delete $new_suggestion->{STATUS}; my $rs = Koha::Database->new->schema->resultset('Suggestion'); - return $rs->create($new_suggestion)->id; + return $rs->create($suggestion)->id; } =head2 ModSuggestion @@ -452,19 +449,14 @@ sub ModSuggestion { my ($suggestion) = @_; return unless( $suggestion and defined($suggestion->{suggestionid}) ); - my $mod_suggestion = { %$suggestion }; - my $status = $suggestion->{STATUS}; - delete $mod_suggestion->{STATUS}; - $mod_suggestion->{status} = $status; - my $rs = Koha::Database->new->schema->resultset('Suggestion')->find($suggestion->{suggestionid}); my $status_update_table = 1; eval { - $rs->update($mod_suggestion); + $rs->update($suggestion); }; $status_update_table = 0 if( $@ ); - if ( $status ) { + if ( $suggestion->{STATUS} ) { # fetch the entire updated suggestion so that we can populate the letter my $full_suggestion = GetSuggestion( $suggestion->{suggestionid} ); -- 1.9.1