X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FRecord.pm;h=f2236b019d70307293821c241877dc4deed58a9a;hb=3737dfd3e904c8b309ab6f773205d1bdc1ab2d5c;hp=4623766913febc4d9f1c858c46f9b7697651e141;hpb=c50ac2e99690064ac74868f076cc5590448d95aa;p=freeside.git diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index 462376691..f2236b019 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -1584,7 +1584,7 @@ Table name (required). =item params -Listref of field names for static fields. They will be given values from the +Arrayref of field names for static fields. They will be given values from the PARAMS hashref and passed as a "params" hashref to batch_import. =item formats @@ -1633,13 +1633,15 @@ format_types). =back -PARAMS is a base64-encoded Storable string containing the POSTed data as -a hash ref. It normally contains at least one field, "uploaded files", -generated by /elements/file-upload.html and containing the list of uploaded -files. Currently only supports a single file named "file". +PARAMS is a hashref (or base64-encoded Storable hashref) containing the +POSTed data. It must contain the field "uploaded files", generated by +/elements/file-upload.html and containing the list of uploaded files. +Currently only supports a single file named "file". =cut +# uploaded_files is kind of bizarre; fix that some time + use Storable qw(thaw); use Data::Dumper; use MIME::Base64; @@ -1650,7 +1652,13 @@ sub process_batch_import { my @pass_params = $opt->{params} ? @{ $opt->{params} } : (); my %formats = %{ $opt->{formats} }; - my $param = thaw(decode_base64(shift)); + my $param = shift; + # because some job-spawning code (JSRPC) pre-freezes the arguments, + # and then the 'frozen' attribute doesn't get set, and thus $job->args + # doesn't know to thaw them, we have to do this everywhere. + if (!ref $param) { + $param = thaw(decode_base64($param)); + } warn Dumper($param) if $DEBUG; my $files = $param->{'uploaded_files'}