Permalink
Browse files

Item14024: Item14025: work around allow_nonref issue in JSON::XS 3.02

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...
1 parent 78cc12d commit 6a952f501a96335223c226048dd4bf733de2aa24 @jast jast committed Apr 4, 2016
@@ -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",
@@ -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};

0 comments on commit 6a952f5

Please sign in to comment.