From 2a6d22aa6561a84b3df029dbfb960e434ac3dff6 Mon Sep 17 00:00:00 2001 From: Tiffany Little Date: Mon, 27 Mar 2023 15:42:07 -0400 Subject: [PATCH] LP1618199_Prefer ISBN13 as LI identifier Signed-off-by: Tiffany Little --- Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm index 011d7e0936..063386bc14 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/Lineitem.pm @@ -296,9 +296,13 @@ sub set_default_order_ident { if (grep {$_->order_ident eq 't'} @{$li->attributes}) { return ; } # Caller wants us to apply a default order identifier - # Use the first ISBN as the default. + # If there's an ISBN13, use that first - my ($attr) = grep {$_->attr_name eq 'isbn'} @{$li->attributes}; + ($attr) = grep { + $_->attr_name eq 'isbn' and + $_->attr_type eq 'lineitem_marc_attr_definition' and + length($_->attr_value) == 13 + } @$attrs; if (!$attr) { return; } -- 2.11.0