Fixed RT#30498 - REST controller references Catalyst without loading it first.
Fixed RT#32042 - Import of Params::Validate :all plays badly with subclasses that have their own validate()
Fixed RT#30456 - Debug messages print even with debugging disabled
+Thu Jan 3 19:42:16 EST 2008
+ Fixed RT#30498 - REST controller references Catalyst without
+ loading it first.
+ Fixed RT#32042 - Import of Params::Validate :all plays badly
+ with subclasses that have their own validate()
+ Fixed RT#30456 - Debug messages print even with debugging disabled
+
Thu Jan 3 08:54:09 PST 2008
Fixed an issue where YAML::Syck versions 0.92 require $c->request->body to
- be stringified
+ be stringified
Fri Dec 21 15:23:46 EDT 2007
Updated the configuration specifiers to operate more in line with the way
require $sp
};
if ($@) {
- $c->log->debug("Could not load $serializer, refusing to serialize: $@");
+ $c->log->debug("Could not load $serializer, refusing to serialize: $@")
+ if $c->debug;
return 0;
}
my $body = $c->request->body;
$c->request->data($rdata);
} else {
$c->log->debug(
- 'I would have deserialized, but there was nothing in the body!');
+ 'I would have deserialized, but there was nothing in the body!')
+ if $c->debug;
}
return 1;
}
require XML::Simple;
};
if ($@) {
- $c->log->debug("Could not load XML::Simple, refusing to deserialize: $@");
+ $c->log->debug("Could not load XML::Simple, refusing to deserialize: $@")
+ if $c->debug;
return 0;
}
}
} else {
$c->log->debug(
- 'I would have deserialized, but there was nothing in the body!');
+ 'I would have deserialized, but there was nothing in the body!')
+ if $c->debug;
}
return 1;
}
use base 'Catalyst::Action';
use Class::Inspector;
+use Catalyst;
use Catalyst::Request::REST;
use 5.8.1;
require XML::Simple
};
if ($@) {
- $c->log->debug("Could not load XML::Serializer, refusing to serialize: $@");
+ $c->log->debug("Could not load XML::Serializer, refusing to serialize: $@")
+ if $c->debug;
return 0;
}
my $xs = XML::Simple->new(ForceArray => 0,);
$self->_serialize_plugins( \@plugins );
}
- my $content_type = $c->request->preferred_content_type;
+ my $content_type = $c->request->preferred_content_type || '';
# Finally, we load the class. If you have a default serializer,
# and we still don't have a content-type that exists in the map,
eval { require $load_class; };
if ($@) {
$c->log->error(
- "Error loading $sclass for " . $content_type . ": $!" )
- if $c->log->is_debug;
+ "Error loading $sclass for " . $content_type . ": $!" );
return $self->_unsupported_media_type($c, $content_type);
} else {
$self->_loaded_plugins->{$sclass} = 1;
use strict;
use warnings;
use base 'Catalyst::Controller';
-use Params::Validate qw(:all);
+use Params::Validate qw(SCALAR OBJECT);
__PACKAGE__->mk_accessors(qw(serialize));
sub status_ok {
my $self = shift;
my $c = shift;
- my %p = validate( @_, { entity => 1, }, );
+ my %p = Params::Validate::validate( @_, { entity => 1, }, );
$c->response->status(200);
$self->_set_entity( $c, $p{'entity'} );
sub status_created {
my $self = shift;
my $c = shift;
- my %p = validate(
+ my %p = Params::Validate::validate(
@_,
{
location => { type => SCALAR | OBJECT },
sub status_accepted {
my $self = shift;
my $c = shift;
- my %p = validate( @_, { entity => 1, }, );
+ my %p = Params::Validate::validate( @_, { entity => 1, }, );
$c->response->status(202);
$self->_set_entity( $c, $p{'entity'} );
sub status_bad_request {
my $self = shift;
my $c = shift;
- my %p = validate( @_, { message => { type => SCALAR }, }, );
+ my %p = Params::Validate::validate( @_, { message => { type => SCALAR }, }, );
$c->response->status(400);
$c->log->debug( "Status Bad Request: " . $p{'message'} ) if $c->debug;
sub status_not_found {
my $self = shift;
my $c = shift;
- my %p = validate( @_, { message => { type => SCALAR }, }, );
+ my %p = Params::Validate::validate( @_, { message => { type => SCALAR }, }, );
$c->response->status(404);
$c->log->debug( "Status Not Found: " . $p{'message'} ) if $c->debug;