fixing a problem with hex and JSON
gettign rid of the migration.txt script, because it's now published on the site instead since all changes are complete
This commit is contained in:
parent
988975abea
commit
d24ac0b273
11 changed files with 10 additions and 952 deletions
|
|
@ -795,7 +795,7 @@ sub getBadgeSelector {
|
|||
}
|
||||
}
|
||||
$js = '<script type="text/javascript">
|
||||
var badges = '.objToJson(\%badgeJS).';
|
||||
var badges = '.objToJson(\%badgeJS,{pretty => 1, indent => 4, autoconv=>0, skipinvalid=>1}).';
|
||||
</script>';
|
||||
%options = (%options,%{$badges});
|
||||
$output .= WebGUI::Form::selectBox($self->session,{
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ sub exportPackage {
|
|||
my $storage = WebGUI::Storage->createTemp($self->session);
|
||||
foreach my $asset (@{$self->getLineage(["self","descendants"],{returnObjects=>1})}) {
|
||||
my $data = $asset->exportAssetData;
|
||||
$storage->addFileFromScalar($data->{properties}{lineage}.".json", JSON::objToJson($data));
|
||||
$storage->addFileFromScalar($data->{properties}{lineage}.".json", JSON::objToJson($data,{pretty => 1, indent => 4, autoconv=>0, skipinvalid=>1}));
|
||||
foreach my $storageId (@{$data->{storage}}) {
|
||||
my $assetStorage = WebGUI::Storage->get($self->session, $storageId);
|
||||
$assetStorage->tar($storageId.".storage", $storage);
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ sub delete {
|
|||
my $param = shift;
|
||||
delete $self->{_config}{$param};
|
||||
open(FILE,">".$self->getWebguiRoot.'/etc/'.$self->getFilename);
|
||||
print FILE "# config-file-type: JSON 1\n".objToJson($self->{_config}, {pretty => 1, indent => 2});
|
||||
print FILE "# config-file-type: JSON 1\n".objToJson($self->{_config}, {pretty => 1, indent => 4, autoconv=>0, skipinvalid=>1});
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
|
|
@ -376,7 +376,7 @@ sub set {
|
|||
my $value = shift;
|
||||
$self->{_config}{$param} = $value;
|
||||
open(FILE,">".$self->getWebguiRoot.'/etc/'.$self->getFilename);
|
||||
print FILE "# config-file-type: JSON 1\n".objToJson($self->{_config}, {pretty => 1, indent => 2});
|
||||
print FILE "# config-file-type: JSON 1\n".objToJson($self->{_config}, {pretty => 1, indent => 4, autoconv=>0, skipinvalid=>1});
|
||||
close(FILE);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -403,7 +403,7 @@ sub showDebug {
|
|||
$text = $self->session->stow->get('debug_info');
|
||||
$text =~ s/\n/\<br \/\>\n/g;
|
||||
$output .= '<div style="text-align: left;background-color: #ffffdd;color: #000000;">'.$text."</div>\n";
|
||||
$text = JSON::objToJson($self->session->form->paramsHashRef(), {pretty=>1, indent=>4});
|
||||
$text = JSON::objToJson($self->session->form->paramsHashRef(), {pretty => 1, indent => 4, autoconv=>0, skipinvalid=>1});
|
||||
$text =~ s/&/&/xsg;
|
||||
$text =~ s/>/>/xsg;
|
||||
$text =~ s/</</xsg;
|
||||
|
|
|
|||
|
|
@ -70,9 +70,6 @@ sub generate {
|
|||
my $id = Digest::MD5::md5_base64($v);
|
||||
$id =~ s/\+/_/g;
|
||||
$id =~ s/\//-/g;
|
||||
if ($id =~ /^0/) { # Can't start with 0 because that can cause problems with 0x (hex) and 0b (bin) in perl
|
||||
$id = $self->generate();
|
||||
}
|
||||
return $id;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ sub set {
|
|||
$self->{_data}{className} = (exists $properties->{className}) ? $properties->{className} : $self->{_data}{className};
|
||||
$self->{_data}{methodName} = (exists $properties->{methodName}) ? $properties->{methodName} : $self->{_data}{methodName};
|
||||
if (exists $properties->{parameters}) {
|
||||
$self->{_data}{parameters} = JSON::objToJson({parameters => $properties->{parameters}});
|
||||
$self->{_data}{parameters} = JSON::objToJson({parameters => $properties->{parameters}},{pretty => 1, indent => 4, autoconv=>0, skipinvalid=>1});
|
||||
}
|
||||
$self->{_data}{enabled} = 0 unless ($self->{_data}{workflowId});
|
||||
my $spectre = WebGUI::Workflow::Spectre->new($self->session);
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ sub create {
|
|||
my $session = shift;
|
||||
my $properties = shift;
|
||||
my ($isSingleton) = $session->db->quickArray("select isSingleton from Workflow where workflowId=?",[$properties->{workflowId}]);
|
||||
my $params = (exists $properties->{parameters}) ? JSON::objToJson({parameters => $properties->{parameters}}) : undef;
|
||||
my $params = (exists $properties->{parameters}) ? JSON::objToJson({parameters => $properties->{parameters}}, {pretty => 1, indent => 4, autoconv=>0, skipinvalid=>1}) : undef;
|
||||
my ($count) = $session->db->quickArray("select count(*) from WorkflowInstance where workflowId=? and parameters=?",[$properties->{workflowId},$params]);
|
||||
return undef if ($isSingleton && $count);
|
||||
my $instanceId = $session->db->setRow("WorkflowInstance","instanceId",{instanceId=>"new", runningSince=>time()});
|
||||
|
|
@ -366,7 +366,7 @@ sub set {
|
|||
$self->{_data}{className} = (exists $properties->{className}) ? $properties->{className} : $self->{_data}{className};
|
||||
$self->{_data}{methodName} = (exists $properties->{methodName}) ? $properties->{methodName} : $self->{_data}{methodName};
|
||||
if (exists $properties->{parameters}) {
|
||||
$self->{_data}{parameters} = JSON::objToJson({parameters => $properties->{parameters}});
|
||||
$self->{_data}{parameters} = JSON::objToJson({parameters => $properties->{parameters}}, {pretty => 1, indent => 4, autoconv=>0, skipinvalid=>1});
|
||||
}
|
||||
$self->{_data}{currentActivityId} = (exists $properties->{currentActivityId}) ? $properties->{currentActivityId} : $self->{_data}{currentActivityId};
|
||||
$self->{_data}{lastUpdate} = time();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue