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

Owner: Nobody in particular
Requestors: converter [...]

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


Subject: Plugin config defaults overwrite user config
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1327104992-14878-34"
Content-Length: 0
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 702
Download (untitled) / with headers
text/plain 702b
&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
MIME-Version: 1.0
Content-Type: application/octet-stream; name="Catalyst-Plugin-Snippets-fix-config.patch"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline; filename="Catalyst-Plugin-Snippets-fix-config.patch"
Content-Transfer-Encoding: base64
Content-Length: 656
--- /opt/perl/lib/site_perl/5.14.2/Catalyst/Plugin/ 2012-01-20 17:55:44.000000000 -0600 +++ /opt/perl/lib/site_perl/5.14.2/Catalyst/Plugin/ 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;
MIME-Version: 1.0
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Type: text/plain; charset="UTF-8"
Message-ID: <rt-3.8.HEAD-20177-1336224902-853.74195-0-0 [...]>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 223
Download (untitled) / with headers
text/plain 223b
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 :)

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

Please report any issues with to