X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FComponent.pm;h=1ea719fd8068635460b1c29bc4cf56b88b76a6d5;hp=f74709980a3140c6d1d0462f638cfa9783ab2d90;hb=bcb87e823493966b483e008df263b80adcedc776;hpb=d0a02856666b38a92f5905e86e11fd053dff91bd diff --git a/lib/Catalyst/Component.pm b/lib/Catalyst/Component.pm index f747099..1ea719f 100644 --- a/lib/Catalyst/Component.pm +++ b/lib/Catalyst/Component.pm @@ -74,14 +74,12 @@ __PACKAGE__->mk_classdata('_config'); has catalyst_component_name => ( is => 'ro' ); # Cannot be required => 1 as context # class @ISA component - HATE -# Make accessor callable as a class method, as we need to call setup_actions -# on the application class, which we don't have an instance of, ewwwww -# Also, naughty modules like Catalyst::View::JSON try to write to _everything_, +# Naughty modules like Catalyst::View::JSON try to write to _everything_, # so spit a warning, ignore that (and try to do the right thing anyway) here.. around catalyst_component_name => sub { my ($orig, $self) = (shift, shift); Carp::cluck("Tried to write to the catalyst_component_name accessor - is your component broken or just mad? (Write ignored - using default value.)") if scalar @_; - blessed($self) ? $self->$orig() || blessed($self) : $self; + return $self->$orig() || blessed($self); }; sub BUILDARGS {