Skip Menu |
 

This queue is for tickets about the Catalyst-View-JSON CPAN distribution.

Report information
The Basics
Id: 122397
Status: open
Priority: 0/
Queue: Catalyst-View-JSON

People
Owner: Nobody in particular
Requestors: brahmina [...] brahminacreations.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Missing allow_blessed, convert_blessed nor allow_tags settings for JASON
Date: Sat, 8 Jul 2017 15:10:25 -0700
To: bug-Catalyst-View-JSON [...] rt.cpan.org
From: Brahmina <brahmina [...] brahminacreations.com>
Download (untitled) / with headers
text/plain 630b
I encountered the error: Caught exception in $CATALYSTAPP::View::JSON->process "encountered object '$JSONCALLURL', but neither allow_blessed, convert_blessed nor allow_tags settings are enabled (or TO_JSON/FREEZE method missing) at /usr/share/perl5/Catalyst/View/JSON.pm line 48." I was able to fix the error by changing line 46 of Catalyst::View::JSON to: my %args = (utf8=>1, %{$self->json_encoder_args ||+{ allow_blessed => 1 }}); Not sure, but I'm guessing this error arose from the latest release of JSON::XS, as this error wasn't an issue with similar Catalyst projects I've had in the past. Thanks! Brahmina Burgess
Download (untitled) / with headers
text/plain 1005b
On 2017-07-08 15:11:21, brahmina@brahminacreations.com wrote: Show quoted text
> I encountered the error: > > Caught exception in $CATALYSTAPP::View::JSON->process "encountered object > '$JSONCALLURL', but neither allow_blessed, convert_blessed nor allow_tags > settings are enabled (or TO_JSON/FREEZE method missing) at > /usr/share/perl5/Catalyst/View/JSON.pm line 48." > > I was able to fix the error by changing line 46 of Catalyst::View::JSON to: > > my %args = (utf8=>1, %{$self->json_encoder_args ||+{ allow_blessed => 1 }}); > > Not sure, but I'm guessing this error arose from the latest release > of JSON::XS, as this error wasn't an issue with similar Catalyst projects > I've had in the past.
I don't think you're normally intended to have blessed objects in the stash -- but nevertheless, you can modify the arguments passed to the serializer by setting the 'json_encoder_args' config option. There is no need to patch this module itself. https://metacpan.org/pod/Catalyst::View::JSON#json_encoder_args
Subject: Re: [rt.cpan.org #122397] Missing allow_blessed, convert_blessed nor allow_tags settings for JASON
Date: Wed, 12 Jul 2017 20:08:54 -0700
To: bug-Catalyst-View-JSON [...] rt.cpan.org
From: Brahmina <brahmina [...] brahminacreations.com>
Download (untitled) / with headers
text/plain 1.2k
I guess that was staring me right in the face. Thanks for taking the time to respond. 'Mina On Wed, Jul 12, 2017 at 1:02 PM, Karen Etheridge via RT < bug-Catalyst-View-JSON@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=122397 > > > On 2017-07-08 15:11:21, brahmina@brahminacreations.com wrote:
> > I encountered the error: > > > > Caught exception in $CATALYSTAPP::View::JSON->process "encountered
> object
> > '$JSONCALLURL', but neither allow_blessed, convert_blessed nor allow_tags > > settings are enabled (or TO_JSON/FREEZE method missing) at > > /usr/share/perl5/Catalyst/View/JSON.pm line 48." > > > > I was able to fix the error by changing line 46 of Catalyst::View::JSON
> to:
> > > > my %args = (utf8=>1, %{$self->json_encoder_args ||+{ allow_blessed => 1
> }});
> > > > Not sure, but I'm guessing this error arose from the latest release > > of JSON::XS, as this error wasn't an issue with similar Catalyst projects > > I've had in the past.
> > I don't think you're normally intended to have blessed objects in the > stash -- > but nevertheless, you can modify the arguments passed to the serializer by > setting the 'json_encoder_args' config option. There is no need to patch > this module itself. > > https://metacpan.org/pod/Catalyst::View::JSON#json_encoder_args > >


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

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.