Bug 35138: Adjust existing data

We want the label from the DB displayed on the UI so we are adjusting
the yaml and the DB.

Sponsored-by: The Research University in the Helmholtz Association (KIT)
Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2024-03-21 10:15:23 +01:00 committed by Katrin Fischer
parent ef5307d254
commit e7b0bf583b
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 43 additions and 10 deletions

View File

@ -986,7 +986,7 @@ biblios:
type: ''
author:
facet_order: 1
label: author
label: Authors
mandatory: ~
mappings:
- facet: 1
@ -1281,7 +1281,7 @@ biblios:
type: ''
ccode:
facet_order: 7
label: collection-code
label: Collections
mandatory: ~
mappings:
- facet: 1
@ -1875,7 +1875,7 @@ biblios:
type: geo_point
holdingbranch:
facet_order: 8
label: holdinglibrary
label: Holding libraries
mandatory: ~
mappings:
- facet: 1
@ -1893,7 +1893,7 @@ biblios:
type: string
homebranch:
facet_order: 9
label: homelibrary
label: Home libraries
mandatory: ~
mappings:
- facet: 1
@ -2151,7 +2151,7 @@ biblios:
type: ''
itype:
facet_order: 2
label: itype
label: Item types
mandatory: ~
mappings:
- facet: 1
@ -2503,7 +2503,7 @@ biblios:
type: ''
ln:
facet_order: 10
label: ln
label: Languages
mandatory: ~
mappings:
- facet: 1
@ -2584,7 +2584,7 @@ biblios:
type: number
location:
facet_order: 3
label: location
label: Location
mandatory: ~
mappings:
- facet: 1
@ -3380,7 +3380,7 @@ biblios:
type: ''
su-geo:
facet_order: 4
label: su-geo
label: Places
mandatory: ~
mappings:
- facet: 1
@ -3398,7 +3398,7 @@ biblios:
type: string
subject:
facet_order: 6
label: subject
label: Topics
mandatory: ~
mappings:
- facet: 1
@ -4160,7 +4160,7 @@ biblios:
type: ''
title-series:
facet_order: 5
label: title-series
label: Series
mandatory: ~
mappings:
- facet: 1

View File

@ -0,0 +1,33 @@
use Modern::Perl;
return {
bug_number => "35138",
description => "Make the elastic facets editable",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
my $facets = {
author => 'Authors',
itype => 'Item types',
location => 'Location',
'su-geo' => 'Places',
'title-series' => 'Series',
subject => 'Topics',
ln => 'Languages',
};
# 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 = ?
});
while ( my ( $name, $label ) = each %$facets ) {
$sth->execute( $label, $name, $name );
}
$sth->execute( 'Collections', 'ccode', 'collection-code');
$sth->execute( 'Holding libraries', 'holdingbranch', 'holdinglibrary');
$sth->execute( 'Home libraries', 'homebranch', 'homelibrary');
},
};