Fix an edge case where invalid JSON is written the database. Fixes bug #12303.
This commit is contained in:
parent
b1133d9118
commit
200494b28d
3 changed files with 16 additions and 1 deletions
|
|
@ -169,7 +169,7 @@ sub addType {
|
|||
my $questionType = shift;
|
||||
my $address = shift;
|
||||
my $question = $self->question($address);
|
||||
my $ansString = $question->{answers} ? to_json $question->{answers} : {};
|
||||
my $ansString = $question->{answers} ? to_json $question->{answers} : '{}';
|
||||
$self->session->db->write("INSERT INTO Survey_questionTypes VALUES(?,?) ON DUPLICATE KEY UPDATE answers = ?",[$questionType,$ansString,$ansString]);
|
||||
$question->{questionType} = $questionType;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue