Bug 24564: Do not modify the tab of existing subfield in ifla/update.pl

Test plan:
1. Find a biblio subfield in
   misc/migration_tools/ifla/data/biblio/default.yml that you have in
   your default biblio MARC framework (or create one).
2. Change the tab of this subfield so that it's different from what's in
   the .yml file
3. Run misc/migration_tools/ifla/update.pl --force
4. Verify that the tab of this subfield has not been changed.
5. Do the same for authorities (files are in
   misc/migration_tools/ifla/data/auth/)

Signed-off-by: sonia <sonia.bouis@univ-lyon3.fr>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Julian Maurice 2021-03-31 10:44:48 +02:00 committed by Jonathan Druart
parent 539fc6809a
commit 2f522d8ad4
1 changed files with 12 additions and 2 deletions

View File

@ -236,7 +236,12 @@ for my $subfield (@subfields) {
say sprintf('Subfield already exists: %s$%s', $subfield->{tagfield}, $subfield->{tagsubfield});
if ($force) {
say sprintf('Force mode is active, updating subfield %s$%s', $subfield->{tagfield}, $subfield->{tagsubfield});
$mss->update($subfield);
# Do not modify the tab of existing subfield
my %values = %$subfield;
delete $values{tab};
$mss->update(\%values);
}
next;
}
@ -299,7 +304,12 @@ for my $authsubfield (@authsubfields) {
say sprintf('Auth subfield already exists: %s$%s (%s)', $authsubfield->{tagfield}, $authsubfield->{tagsubfield}, $authsubfield->{authtypecode});
if ($force) {
say sprintf('Force mode is active, updating auth subfield %s$%s (%s)', $authsubfield->{tagfield}, $authsubfield->{tagsubfield}, $authsubfield->{authtypecode});
$ass->update($authsubfield);
# Do not modify the tab of existing subfield
my %values = %$authsubfield;
delete $values{tab};
$ass->update(\%values);
}
next;
}