fix JSON encoding problems in Shop/ShipDriver

This commit is contained in:
Colin Kuskie 2008-07-08 21:27:15 +00:00
parent 631bade4f6
commit 35ff40e4b2

View file

@ -158,7 +158,7 @@ sub get {
$opts = {};
}
else {
$opts = JSON::from_json($opts);
$opts = decode_json($opts);
}
if (defined $param) {
return $opts->{$param};
@ -303,7 +303,7 @@ sub update {
my $options = shift || {};
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 };
my $jsonOptions = to_json($options);
my $jsonOptions = encode_json($options);
$options{id $self} = $jsonOptions;
$self->session->db->write('update shipper set options=? where shipperId=?', [$jsonOptions, $self->getId]);
return undef;