From 31e62a20c2e9e644158cc0e192297e2acd33de93 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 12 Apr 2024 09:03:46 +0000 Subject: [PATCH] Bug 35138: (QA followup) Tidy update Signed-off-by: Nick Clemens --- .../data/mysql/atomicupdate/bug_35138.pl | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_35138.pl b/installer/data/mysql/atomicupdate/bug_35138.pl index 224a9b0aca8..27fb8a4e596 100755 --- a/installer/data/mysql/atomicupdate/bug_35138.pl +++ b/installer/data/mysql/atomicupdate/bug_35138.pl @@ -16,33 +16,38 @@ return { subject => 'Topics', ln => 'Languages', }; + # Do not update the label if different from the original one - my $sth = $dbh->prepare(q{ + my $sth = $dbh->prepare( + q{ UPDATE search_field SET label = ? WHERE name = ? AND label = ? - }); + } + ); while ( my ( $name, $label ) = each %$facets ) { $sth->execute( $label, $name, $name ); } - $sth->execute( 'Collections', 'ccode', 'collection-code'); + $sth->execute( 'Collections', 'ccode', 'collection-code' ); # Deal with DisplayLibraryFacets - my ($DisplayLibraryFacets) = $dbh->selectrow_array(q{ + my ($DisplayLibraryFacets) = $dbh->selectrow_array( + q{ SELECT value FROM systempreferences WHERE variable='DisplayLibraryFacets' - }); - my ($homebranch, $holdingbranch); + } + ); + my ( $homebranch, $holdingbranch ); if ( $DisplayLibraryFacets eq 'both' ) { - $homebranch = 1; + $homebranch = 1; $holdingbranch = 1; } elsif ( $DisplayLibraryFacets eq 'holding' ) { $holdingbranch = 1; } elsif ( $DisplayLibraryFacets eq 'home' ) { $homebranch = 1; } - $sth->execute( 'Holding libraries', 'holdingbranch', 'holdinglibrary') if $holdingbranch; - $sth->execute( 'Home libraries', 'homebranch', 'homelibrary') if $homebranch; + $sth->execute( 'Holding libraries', 'holdingbranch', 'holdinglibrary' ) if $holdingbranch; + $sth->execute( 'Home libraries', 'homebranch', 'homelibrary' ) if $homebranch; }, }; -- 2.39.2