Minor fix. JSON no longer assumes proper utf8, but uses whatever off-brand locale a luser wants to use.
This commit is contained in:
parent
a4207e7ec5
commit
5127a307b7
3 changed files with 9 additions and 9 deletions
|
|
@ -277,7 +277,7 @@ sub www_submitObjectEdit {
|
|||
return $self->session->privilege->insufficient()
|
||||
unless ($self->session->user->isInGroup($self->get('groupToEditSurvey')));
|
||||
|
||||
# my $ref = @{decode_json($self->session->form->process("data"))};
|
||||
# my $ref = @{from_json($self->session->form->process("data"))};
|
||||
my $responses = $self->session->form->paramsHashRef();
|
||||
|
||||
my @address = split /-/, $responses->{id};
|
||||
|
|
@ -367,7 +367,7 @@ sub www_dragDrop {
|
|||
return $self->session->privilege->insufficient()
|
||||
unless ($self->session->user->isInGroup($self->get('groupToEditSurvey')));
|
||||
|
||||
my $p = decode_json( $self->session->form->process("data") );
|
||||
my $p = from_json( $self->session->form->process("data") );
|
||||
|
||||
my @tid = split /-/, $p->{target}->{id};
|
||||
my @bid = split /-/, $p->{before}->{id};
|
||||
|
|
@ -512,7 +512,7 @@ sub www_loadSurvey {
|
|||
"ddhtml", $html, "ids", \@ids, "type", $var->{type}
|
||||
};
|
||||
$self->session->http->setMimeType('application/json');
|
||||
return encode_json($return);
|
||||
return to_json($return);
|
||||
} ## end sub www_loadSurvey
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -768,7 +768,7 @@ sub surveyEnd {
|
|||
}
|
||||
}
|
||||
# $self->session->http->setRedirect($url);
|
||||
return encode_json({ "type", "forward", "url", $url });
|
||||
return to_json({ "type", "forward", "url", $url });
|
||||
} ## end sub surveyEnd
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
@ -825,7 +825,7 @@ sub prepareShowSurveyTemplate {
|
|||
my $out = $self->processTemplate( $section, $self->get("surveyQuestionsId") );
|
||||
|
||||
$self->session->http->setMimeType('application/json');
|
||||
return encode_json( { "type", "displayquestions", "section", $section, "questions", $questions, "html", $out } );
|
||||
return to_json( { "type", "displayquestions", "section", $section, "questions", $questions, "html", $out } );
|
||||
} ## end sub prepareShowSurveyTemplate
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ sub new {
|
|||
my $json = shift;
|
||||
my $log = shift;
|
||||
my $survey = shift;
|
||||
my $temp = decode_json($json) if defined $json;
|
||||
my $temp = from_json($json) if defined $json;
|
||||
my $self = defined $temp ? $temp : {};
|
||||
$self->{survey} = $survey;
|
||||
$self->{log} = $log;
|
||||
|
|
@ -84,7 +84,7 @@ sub freeze {
|
|||
my %temp = %{$self};
|
||||
delete $temp{log};
|
||||
delete $temp{survey};
|
||||
return encode_json( \%temp );
|
||||
return to_json( \%temp );
|
||||
}
|
||||
|
||||
#Hash the survey timed out?
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ sub new {
|
|||
my $log = shift;
|
||||
my $self = {};
|
||||
$self->{log} = $log;
|
||||
my $temp = decode_json($json) if defined $json;
|
||||
my $temp = from_json($json) if defined $json;
|
||||
$self->{sections} = defined $temp->{sections} ? $temp->{sections} : [];
|
||||
$self->{survey} = defined $temp->{survey} ? $temp->{survey} : {};
|
||||
bless( $self, $class );
|
||||
|
|
@ -75,7 +75,7 @@ sub freeze {
|
|||
my %temp;
|
||||
$temp{sections} = $self->{sections};
|
||||
$temp{survey} = $self->{survey};
|
||||
return encode_json( \%temp );
|
||||
return to_json( \%temp );
|
||||
}
|
||||
|
||||
=head2 newObject ( $address )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue