Skip to content

Commit

Permalink
Fixing lingering file metadata when uploading new files #762
Browse files Browse the repository at this point in the history
  • Loading branch information
phochste committed Jul 2, 2019
1 parent 6fc1bdc commit 0b1ac98
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/LibreCat/App/Catalogue/Controller/File.pm
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ sub upload_temp_file {
creator => $creator,
date_updated => $now,
date_created => $now,
request => $opts
};

$file_data->{rac_email} = $rac_email if $rac_email;
Expand Down Expand Up @@ -135,7 +134,14 @@ sub upload_temp_file {

h->log->info("storing file metadata to $config_file");

my $json = Catmandu->export_to_string($file_data, 'JSON',line_delimited=>1);
# Add some contextual data to the file metadata which shouldn't be
# stored in the database...
my $request_file_data = {
%$file_data ,
request => $opts
};

my $json = Catmandu->export_to_string($request_file_data, 'JSON',line_delimited=>1);

h->log->debug("storing: $json");

Expand Down

0 comments on commit 0b1ac98

Please sign in to comment.