Skip to content

Commit

Permalink
Item14024: Item14025: work around allow_nonref issue in JSON::XS 3.02
Browse files Browse the repository at this point in the history
In some setups references are no longer correctly detected as such with
this update to JSON::XS. Turn off the check to suppress incorrect
errors; we know that we're passing a reference.
  • Loading branch information
jast committed Apr 4, 2016
1 parent 78cc12d commit 6a952f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion JQueryPlugin/lib/Foswiki/Plugins/JQueryPlugin/FOSWIKI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ sub init {

my $text =
"<script class='\$zone \$id foswikiPreferences' type='text/json'>"
. JSON::to_json( \%prefs, { pretty => 1 } )
. JSON::to_json( \%prefs, { pretty => 1, allow_nonref => 1 } )
. "</script>";

Foswiki::Func::addToZone( "script", "JQUERYPLUGIN::FOSWIKI::PREFERENCES",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ sub json {
my $this = shift;

unless ( defined $this->{json} ) {
$this->{json} = JSON->new->pretty(DEBUG)->convert_blessed(1);
$this->{json} =
JSON->new->pretty(DEBUG)->convert_blessed(1)->allow_nonref(1);
}

return $this->{json};
Expand Down

0 comments on commit 6a952f5

Please sign in to comment.