Bug 12627: DBIx::Class is case sensitive for column names

STATUS should be "STATUS", not "status".

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Jonathan Druart 2014-09-29 15:18:31 +02:00 committed by Tomas Cohen Arazi
parent 1c2744a83f
commit fed11629e7

View file

@ -426,13 +426,10 @@ Insert a new suggestion on database with value given on input arg.
sub NewSuggestion { sub NewSuggestion {
my ($suggestion) = @_; my ($suggestion) = @_;
my $new_suggestion = { %$suggestion };
$suggestion->{STATUS} = "ASKED" unless $suggestion->{STATUS}; $suggestion->{STATUS} = "ASKED" unless $suggestion->{STATUS};
$new_suggestion->{status} = $suggestion->{STATUS};
delete $new_suggestion->{STATUS};
my $rs = Koha::Database->new->schema->resultset('Suggestion'); my $rs = Koha::Database->new->schema->resultset('Suggestion');
return $rs->create($new_suggestion)->id; return $rs->create($suggestion)->id;
} }
=head2 ModSuggestion =head2 ModSuggestion
@ -452,19 +449,14 @@ sub ModSuggestion {
my ($suggestion) = @_; my ($suggestion) = @_;
return unless( $suggestion and defined($suggestion->{suggestionid}) ); 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 $rs = Koha::Database->new->schema->resultset('Suggestion')->find($suggestion->{suggestionid});
my $status_update_table = 1; my $status_update_table = 1;
eval { eval {
$rs->update($mod_suggestion); $rs->update($suggestion);
}; };
$status_update_table = 0 if( $@ ); $status_update_table = 0 if( $@ );
if ( $status ) { if ( $suggestion->{STATUS} ) {
# fetch the entire updated suggestion so that we can populate the letter # fetch the entire updated suggestion so that we can populate the letter
my $full_suggestion = GetSuggestion( $suggestion->{suggestionid} ); my $full_suggestion = GetSuggestion( $suggestion->{suggestionid} );