Skip to content

Commit

Permalink
fix: issue #9876 import spreadsheet template with mandatory fields (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshisrestha authored and john-gom committed May 24, 2024
1 parent 979982b commit 2766ba6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ ELASTICSEARCH_HOSTS=
LOG_LEVEL_ROOT=TRACE
LOG_LEVEL_MONGODB=TRACE

BUILD_CACHE_REPO=openfoodfacts/openfoodfacts-build-cache
BUILD_CACHE_REPO=openfoodfacts/openfoodfacts-build-cache
6 changes: 5 additions & 1 deletion cgi/generate_sample_import_file.pl
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
$worksheet->set_column('A:A', 30);
$worksheet->write($description_row, 0, $description, $formats{'description'});

my $fields_param = param('fields');

foreach my $group_ref (@$select2_options_ref) {
my $group_start_col = $col;

Expand Down Expand Up @@ -209,6 +211,9 @@
}

# Write cell and comment
if ($fields_param && $fields_param eq 'mandatory' && $importance ne 'mandatory') {
next;
}

$worksheet->write($headers_row, $col, $field_ref->{text}, $formats{$importance});
my $width = length($field_ref->{text});
Expand All @@ -227,4 +232,3 @@
}

exit(0);

0 comments on commit 2766ba6

Please sign in to comment.