Skip to content

Commit

Permalink
Updated ia7_collections_upgrader to add item 700 to the gear modal (i…
Browse files Browse the repository at this point in the history
…tem 500)
  • Loading branch information
hplato committed May 28, 2016
1 parent 2ba3103 commit 9cdd920
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions code/common/ia7_collection_upgrader.pl
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,18 @@
if ($@) {
print_log "[IA7_Collection_Updater] : WARNING: decode_json failed for $file. Please check this file!";
} else {
$json_data->{700}->{user} = '$Authorized' if ($version < 1.2); #IA7 v1.2 required change
if ($version < 1.2) { #IA7 v1.2 required change
$json_data->{700}->{user} = '$Authorized' unless (defined $json_data->{700}->{user});
my $found = 0;
foreach my $i (@{$json_data->{500}->{children}}) {
$found = 1 if ($i == 700);
}
push (@{$json_data->{500}->{children}},700) unless ($found);
}
my $json_newdata = to_json($json_data, {utf8 => 1, pretty => 1});
print $json_newdata;
my $backup_file = $file . ".v" . $version . ".backup";
file_write($backup_file,$file_data);
print_log "[IA7_Collection_Updater] : Saved backup " . $file . ".v" . $version . ".backup";
file_write($file,$json_newdata);
}
}
Expand Down

0 comments on commit 9cdd920

Please sign in to comment.