Bug 32797: Check if fields have a value, not if true

When saving OAI set mappgins we are checking for truth, this prevents
saving subfield 0. We should check for content

To test:
1 - Go to Admin->OAI sets
2 - Create a set
3 - Define mappings for the set
4 - Attempt to save a rule on field 952 subfield 0 (withdrawn)
5 - It does not save
6 - Apply patch
7 - Try again
8 - Success!

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6f606e00c5)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
(cherry picked from commit 677e68c7f1)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 94bb81502b)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
This commit is contained in:
Nick Clemens 2023-02-02 14:57:14 +00:00 committed by Arthur Suzuki
parent c068fcf3a8
commit 82ef4bf41b
1 changed files with 1 additions and 1 deletions

View File

@ -60,7 +60,7 @@ if($op && $op eq "save") {
my @mappings;
my $i = 0;
while($i < @marcfields and $i < @marcsubfields and $i < @marcvalues) {
if($marcfields[$i] and $marcsubfields[$i]) {
if($marcfields[$i] ne '' and $marcsubfields[$i] ne '' ) {
push @mappings, {
marcfield => $marcfields[$i],
marcsubfield => $marcsubfields[$i],