@@ -, +, @@ - Apply the first patch with two new tests - Run something like this: sudo koha-shell -c "prove -v t/db_dependent/OAI/Sets.t" kohadev - Verify that the last test fails - Apply this secind patch - Rerun the test file above - Verify that all tests now pass --- C4/OAI/Sets.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) --- a/C4/OAI/Sets.pm +++ a/C4/OAI/Sets.pm @@ -541,7 +541,18 @@ sub _evalRule { my $subfield = $mapping->{'marcsubfield'}; my $operator = $mapping->{'operator'}; my $value = $mapping->{'marcvalue'}; - my @subfield_values = $record->subfield($field, $subfield); + + my @subfield_values; + # Get all the fields with the given tag + my @fields = $record->field($field); + # Iterate over all the fields + foreach my $field ( @fields ) { + # Get the value from the given subfield + if ( my $subfield_value = $field->subfield($subfield) ) { + push @subfield_values, $subfield_value; + } + } + if ($operator eq 'notequal') { if(0 == grep /^$value$/, @subfield_values) { return 1; --