Skip Menu |

This queue is for tickets about the DBIx-Class-InflateColumn-Serializer CPAN distribution.

Report information
The Basics
Id: 119985
Status: open
Priority: 0/
Queue: DBIx-Class-InflateColumn-Serializer

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

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

Subject: Error on scalar value
Download (untitled) / with headers
text/plain 1.2k
Defined a value in DBIX class with: __PACKAGE__->load_components("InflateColumn::Serializer","Core"); __PACKAGE__->table("testing"); __PACKAGE__->add_columns( 'id' => {}, 'test' => {'serializer_class' => 'JSON', 'serializer_options' => {'allow_nonref' => 1 }}, __PACKAGE__->set_primary_key("id"); Assigning test to any sort of hash or array works great. However if test is a scalar the value will get stored in the database but when you try to retrieve its value I get this error: malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "Fill") at /usr/local/share/perl5/DBIx/Class/InflateColumn/Serializer/ line 91. In the above error the value for test in the database is "Fill" however I think the proper JSON value for decoding in the database would have to be ""Fill"" we need the quotes in the database for JSON to restore it properly. $ perl -v This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi (with 29 registered patches, see perl -V for more detail) $ perl -MDBIx::Class::InflateColumn::Serializer::JSON -e 'print "$DBIx::Class::InflateColumn::Serializer::JSON::VERSION\n"' 0.08
Download (untitled) / with headers
text/plain 183b
Hi! Thanks for your bug report. I'm not sure I fully understand the error reported. Would you mind providing a test case or a code snippet in order to reproduce? Thanks in advance.
Download (untitled) / with headers
text/plain 988b
See attached script: $ ./bug119985 1 malformed JSON string, neither tag, array, object, number, string or atom, at character offset 0 (before "hello") at /export/linux/OCHZIFF/risk_mmcgillis/tools/ver/perl-test/share/perl5/DBIx/Class/InflateColumn/Serializer/ line 91. $ sqlite3 ./bug119985.db SQLite version 3.7.17 2013-05-20 00:56:22 Enter ".help" for instructions Enter SQL statements terminated with a ";" Show quoted text
sqlite> select * from test;
1|hello If you manually update the table so it has 1|"hello" then: my $load=$dbix->resultset('Test')->find($item->id); will work. I did some digging into this and it turns out the root problem isn't in your code but in DBIx::Class::InflateColumn. Turns out when it stores the value in the database it never passes the value to you to process it. So you would either have to not use InflateColumn to fix this or get InflateColumn to have some sort of configuration/setting that allows you to tell it to always pass the value through you.
Subject: bug119985
Download bug119985
application/octet-stream 1k

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 314b
Show quoted text
> See bug: > > For related issue.
The above should have been: Based on information from that bug this code should be based on DBIx::Class::FilterColumn rather than DBIx::Class:InflateColumn to address this bug.

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

Please report any issues with to