From eaf0a55ec163a3413a04ddda80e5b796b3e1725d Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Fri, 7 Sep 2007 15:15:16 +0000 Subject: [PATCH] fix package importing --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/AssetPackage.pm | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index fe4fd0ca9..1f7c19ce5 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -10,6 +10,7 @@ - fix: wrong ssl link in iTransact settings - fix thumbnail script with Graphics::Magick - fix ordering of statuses in In/Out board + - fix package importing 7.4.5 - fix: Apostrophy incorrectly escaped as double quote in some places diff --git a/lib/WebGUI/AssetPackage.pm b/lib/WebGUI/AssetPackage.pm index 53b8083ba..bde8702bb 100644 --- a/lib/WebGUI/AssetPackage.pm +++ b/lib/WebGUI/AssetPackage.pm @@ -181,7 +181,10 @@ sub importPackage { foreach my $file (sort(@{$decompressed->getFiles})) { next unless ($decompressed->getFileExtension($file) eq "json"); $error->info("Found data file $file"); - my $data = eval{JSON::jsonToObj($decompressed->getFileContentsAsScalar($file))}; + my $data = eval{ + local $JSON::UnMapping = 1; + JSON::jsonToObj($decompressed->getFileContentsAsScalar($file)) + }; if ($@ || $data->{properties}{assetId} eq "" || $data->{properties}{className} eq "" || $data->{properties}{revisionDate} eq "") { $error->error("package corruption: ".$@) if ($@); return "corrupt";