Skip Menu |

This queue is for tickets about the Catalyst-Plugin-Snippets CPAN distribution.

Report information
The Basics
Id: 74195
Status: resolved
Priority: 0/
Queue: Catalyst-Plugin-Snippets

People
Owner: Nobody in particular
Requestors: converter [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in:
  • 0.01
  • 0.02



Subject: Plugin config defaults overwrite user config
&Catalyst::Plugin::Snippets::setup assigns several defaults to the "snippets" config hash, but the list of default key/value pairs appear in the assignment list _after_ the values from $app->config->{snippets}, overwriting any values supplied by the user's configuration files. This makes it impossible to configure options like 'format' and etc. The attached patch fixes the issue for me. Sorry if this is bad form, but I though I'd also mention: Looking at the tests I don't see any assignments to the config hash that would exercise the code that serializes/deserializes JSON. Also, the documentation mentions a method called serialize_snippet, but it doesn't appear anywhere in the code.
Subject: Catalyst-Plugin-Snippets-fix-config.patch
--- /opt/perl/lib/site_perl/5.14.2/Catalyst/Plugin/Snippets.pm.orig 2012-01-20 17:55:44.000000000 -0600 +++ /opt/perl/lib/site_perl/5.14.2/Catalyst/Plugin/Snippets.pm 2012-01-20 17:55:54.000000000 -0600 @@ -15,12 +15,12 @@ my $ret = $app->maybe::next::method(@_); %{ $app->config->{snippets} } = ( - %{ $app->config->{snippets} || {} }, format => "plain", allow_refs => 1, use_session_id => 0, json_content_type => "application/javascript+json", content_type => "text/plain", + %{ $app->config->{snippets} || {} }, ); $ret;
I've applied and I'm going to ship this, as it's an obvious fix! However I don't use this module myself. If you are using it and you'd like to fix it, please come yell at us in irc and we'll get you co-maint sorted out :)