diff --git a/installer/data/mysql/atomicupdate/bug_37446_-_fix_search_field_config_homebranch_holdingbranch.pl b/installer/data/mysql/atomicupdate/bug_37446_-_fix_search_field_config_homebranch_holdingbranch.pl new file mode 100755 index 0000000000..0fef0d3cd3 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_37446_-_fix_search_field_config_homebranch_holdingbranch.pl @@ -0,0 +1,23 @@ +use Modern::Perl; + +return { + bug_number => "37446", + description => "Fix holdingbranch and homebranch facet labels", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Do not update the label if different from the original one + my $sth = $dbh->prepare( + q{ + UPDATE search_field + SET label = ? + WHERE name = ? AND label = ? + } + ); + $sth->execute( 'Holding libraries', 'holdingbranch', 'holdinglibrary' ); + $sth->execute( 'Home libraries', 'homebranch', 'homelibrary' ); + + say $out "Updated search field configuration for holdingbranch and homebranch"; + }, +};