@@ -, +, @@ update a relationship such that the 'relationship' field contains a value not listed in the corresponding system preference. ARRAY(whatever) instead. --- about.pl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) --- a/about.pl +++ a/about.pl @@ -474,7 +474,7 @@ $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs; $bad_relationships_count = $bad_relationships_count->[0]->[0]; - my @existing_relationships = $dbh->selectall_arrayref(q{ + my $existing_relationships = $dbh->selectall_arrayref(q{ SELECT DISTINCT(relationship) FROM ( SELECT relationship FROM borrower_relationships WHERE relationship IS NOT NULL @@ -485,17 +485,16 @@ $template->param( 'bad_yaml_prefs' => \@bad_yaml_prefs ) if @bad_yaml_prefs; my %valid_relationships = map { $_ => 1 } split( /,|\|/, C4::Context->preference('borrowerRelationship') ); $valid_relationships{ _bad_data } = 1; # we handle this case in another way - my @wrong_relationships = grep { !$valid_relationships{ $_->[0] } } @existing_relationships; - - if ( @wrong_relationships or $bad_relationships_count ) { + my $wrong_relationships = [ grep { !$valid_relationships{ $_->[0] } } @{$existing_relationships} ]; + if ( $wrong_relationships or $bad_relationships_count ) { $template->param( warnRelationships => 1, ); - if ( @wrong_relationships ) { + if ( $wrong_relationships ) { $template->param( - wrong_relationships => \@wrong_relationships + wrong_relationships => $wrong_relationships ); } if ($bad_relationships_count) { --