From 09fee704d3e76995a94c2ce3660b253a4d14b5f9 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 1 Nov 2024 10:20:43 +0000 Subject: [PATCH] Bug 36603: (QA follow-up) Resolve two conditional declarations Content-Type: text/plain; charset=utf-8 QA tools reported: FAIL authorities/blinddetail-biblio-search.pl FAIL critic # Variables::ProhibitConditionalDeclarations: Got 2 violation(s). Signed-off-by: Marcel de Rooy --- authorities/blinddetail-biblio-search.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/authorities/blinddetail-biblio-search.pl b/authorities/blinddetail-biblio-search.pl index 91bc1dd6ee..cce4ec481d 100755 --- a/authorities/blinddetail-biblio-search.pl +++ b/authorities/blinddetail-biblio-search.pl @@ -113,9 +113,9 @@ if ($authid) { # Manual (online ed., 1.0.0, 2023), pp. 350, 363, 385. if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { my $isnifield = $record->field('010'); - my $isnisubfield = $isnifield->subfield('a') if defined $isnifield; - my $isninumber = $isnisubfield - if defined $isnisubfield && ( $auth_type->auth_tag_to_report =~ /^(200|210|220)$/ ); + my $isnisubfield = $isnifield ? $isnifield->subfield('a') : undef; + my $isninumber = + defined $isnisubfield && ( $auth_type->auth_tag_to_report =~ /^(200|210|220)$/ ) ? $isnisubfield : undef; push( @subfield_loop, { marc_subfield => 'o', marc_values => $isninumber } ) if defined $isninumber; } -- 2.39.5