fix JSON encoding problems in Shop/ShipDriver
This commit is contained in:
parent
631bade4f6
commit
35ff40e4b2
1 changed files with 2 additions and 2 deletions
|
|
@ -158,7 +158,7 @@ sub get {
|
||||||
$opts = {};
|
$opts = {};
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$opts = JSON::from_json($opts);
|
$opts = decode_json($opts);
|
||||||
}
|
}
|
||||||
if (defined $param) {
|
if (defined $param) {
|
||||||
return $opts->{$param};
|
return $opts->{$param};
|
||||||
|
|
@ -303,7 +303,7 @@ sub update {
|
||||||
my $options = shift || {};
|
my $options = shift || {};
|
||||||
WebGUI::Error::InvalidParam->throw(error => 'update was not sent a hashref of options to store in the database')
|
WebGUI::Error::InvalidParam->throw(error => 'update was not sent a hashref of options to store in the database')
|
||||||
unless ref $options eq 'HASH' and scalar keys %{ $options };
|
unless ref $options eq 'HASH' and scalar keys %{ $options };
|
||||||
my $jsonOptions = to_json($options);
|
my $jsonOptions = encode_json($options);
|
||||||
$options{id $self} = $jsonOptions;
|
$options{id $self} = $jsonOptions;
|
||||||
$self->session->db->write('update shipper set options=? where shipperId=?', [$jsonOptions, $self->getId]);
|
$self->session->db->write('update shipper set options=? where shipperId=?', [$jsonOptions, $self->getId]);
|
||||||
return undef;
|
return undef;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue