- Fixed static configured page attribute not being used (RT#56226)
- Test use_json_boolean true
- Fixed search attribute generation for nonexistent relationships
+- Remove trailing newlines from error messages
2.002002 2010-08-03 14:40:50 Europe/Vienna
sub push_error
{
my ( $self, $c, $params ) = @_;
- push( @{$c->stash->{_dbic_crud_errors}}, $params->{message} || 'unknown error' );
+ my $error = 'unknown error';
+ if (exists $params->{message}) {
+ $error = $params->{message};
+ # remove newline from die "error message\n" which is required to not
+ # have the filename and line number in the error text
+ $error =~ s/\n$//;
+ }
+ push( @{$c->stash->{_dbic_crud_errors}}, $error);
}
=method_protected get_errors
$mech->request($req);
cmp_ok( $mech->status, '==', 400, 'attempt with nonexisting relationship fails' );
my $response = JSON::Any->Load( $mech->content);
- is_deeply( $response->{messages}, ["track is neither a relationship nor a column\n"], 'correct error message returned' );
+ is_deeply( $response->{messages}, ['track is neither a relationship nor a column'], 'correct error message returned' );
}
{