Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/GADS/Import.pm
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,10 @@ sub _build_fields
my @fields;
my $column_id = $self->layout->column_id;

my $col_count = 0;
foreach my $field (@$fields_in)
{
$col_count++;
if (
(
($self->update_unique && $self->update_unique == $column_id->id) ||
Expand Down Expand Up @@ -298,6 +300,8 @@ sub _build_fields
$search->{name} = $field if !$self->short_names;
$search->{name_short} = $field if $self->short_names;
my $f_rs = $self->schema->resultset('Layout')->search($search);
error __x"Empty field name in import headings (Column {column})", column => $col_count
unless $field =~ /^\s*$/;
error __x"Layout has more than one field named {name}", name => $field
if $f_rs->count > 1;
error __x"Field '{name}' in import headings not found in table", name => $field
Expand Down