Item13438: error while encoding object to json

pencil
Priority: Urgent
Current State: Closed
Released In: n/a
Target Release:
Applies To: Extension
Component: EditRowPlugin
Branches: master
Reported By: MichaelDaum
Waiting For:
Last Change By: GeorgeClark
For some reason the encoder will have to json-encode a Foswiki::Attr which is a blessed object without a TO_JSON method. As allow_blessed is not set an exception is thrown.

--- a/lib/Foswiki/Plugins/EditRowPlugin/TableCell.pm
+++ b/lib/Foswiki/Plugins/EditRowPlugin/TableCell.pm
@@ -47,7 +47,7 @@ sub render {
     my ( $this, $opts, $render_opts ) = @_;
 
     my $colDef = $opts->{col_defs}->[ $this->{number} ] || $defCol;
-    my $json = JSON->new()->convert_blessed();
+    my $json = JSON->new()->convert_blessed->allow_blessed();

-- MichaelDaum - 29 May 2015

 

ItemTemplate edit

Summary error while encoding object to json
ReportedBy MichaelDaum
Codebase 1.1.9
SVN Range
AppliesTo Extension
Component EditRowPlugin
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:a7a06e0f5199
ReleasedIn n/a
CheckinsOnBranches master
trunkCheckins
masterCheckins distro:a7a06e0f5199
ItemBranchCheckins
Release01x01Checkins
Topic revision: r2 - 02 Jun 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy