fix: 6.99rc0 - shippingOptions not serialized

This commit is contained in:
Roy Johnson 2006-06-16 14:37:28 +00:00
parent 0212cdc044
commit 288be2c599
3 changed files with 17 additions and 6 deletions

View file

@ -61,8 +61,10 @@
- Added new template vars to DataForm
- fix: op=editSubscription causes fatal
- fix: Commerce and groups
- fix: 6.99rc0 - shippingOptions not serialized
- fix: Orphaned asset data (modified test to fix bug in test)
6.99.3
- Someone removed the status from the submission templates. That has been
fixed.

View file

@ -26,9 +26,16 @@ fixSurvey($session);
fixEditWorkflow($session);
fixOrphans();
updateHttpProxy();
fixShippingOptions();
finish($session); # this line required
#-------------------------------------------------
sub fixShippingOptions {
print "\tRemoving unserialized shipping options data from the transaction table.\n";
$session->db->write("update transaction set shippingOptions = null where shippingOptions like '%HASH%'");
}
#-------------------------------------------------
sub updateHttpProxy {
print "\tAllowing HTTP Proxy to use ampersands in addition to semicolons in URLs.\n" unless ($quiet);
@ -64,6 +71,7 @@ sub fixSurvey{
}
}
#--------------------------------------------------
sub fixEditWorkflow {
my @goodPlugins;
my $session = shift;

View file

@ -18,6 +18,7 @@ package WebGUI::Commerce::Transaction;
use strict;
use WebGUI::SQL;
use WebGUI::Commerce::Payment;
use JSON;
#-------------------------------------------------------------------
@ -553,8 +554,8 @@ Returns the shipping options for this transaction. If options is supplied the sh
be set to it.
=head3 options
If supplied the shipping options of the transaction will be set to this value. This should probably
be some serialized datastructure.
If supplied the shipping options of the transaction will be set to this value. The value passed will
be serialized/un-serialized for you.
=cut
@ -563,12 +564,12 @@ sub shippingOptions {
$self = shift;
$shippingOptions = shift;
if ($shippingOptions) {
$self->{_properties}{shippingOptions} = $shippingOptions;
$self->session->db->write("update transaction set shippingOptions=".$self->session->db->quote($shippingOptions)." where transactionId=".$self->session->db->quote($self->{_transactionId}));
if (scalar (keys %{$shippingOptions})) {
$self->{_properties}{shippingOptions} = objToJson($shippingOptions);
$self->session->db->write("update transaction set shippingOptions=? where transactionId=?",[$self->{_properties}{shippingOptions},$self->{_transactionId}]);
}
return $self->{_properties}{shippingOptions};
return jsonToObj($self->{_properties}{shippingOptions});
}
#-------------------------------------------------------------------