From d2cd2d42c6bf17d83a03b9cd3f94a936a61d348a Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 26 Jul 2019 15:45:51 +0000 Subject: [PATCH] Bug 11529: (QA follow-up) Copy existing subtitle mappings and warn others Signed-off-by: Nick Clemens --- installer/data/mysql/atomicupdate/bug_11529.perl | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/atomicupdate/bug_11529.perl b/installer/data/mysql/atomicupdate/bug_11529.perl index 17800bf0ef..034821ddc6 100644 --- a/installer/data/mysql/atomicupdate/bug_11529.perl +++ b/installer/data/mysql/atomicupdate/bug_11529.perl @@ -52,7 +52,18 @@ if( CheckVersion( $DBversion ) ) { }); } - $dbh->do( "DROP TABLE IF EXISTS fieldmapping" ); + $dbh->do("UPDATE marc_subfield_structure JOIN fieldmapping ON tagfield = fieldcode AND subfieldcode=tagsubfield SET kohafield='biblio.subtitle' WHERE fieldmapping.frameworkcode=''"); + $sth = $dbh->prepare("SELECT * FROM fieldmapping WHERE frameworkcode != '' OR field != 'subtitle'"); + $sth->execute; + print "Keyword to MARC mappings below cannot be preserved: \n" if $sth->rows; + while ( my $value = $sth->fetchrow_hashref() ){ + my $framework = $value->{frameworkcode} eq "" ? "Default" : $value->{frameworkcode}; + print " keyword: " . $value->{'field'} . " to field: " . $value->{fieldcode} . "\$" . $value->{subfieldcode} . " for $framework framework\n"; + } + print "You will need to remap using Koha to MARC mappings in administration\n" if $sth->rows; + + +# $dbh->do( "DROP TABLE IF EXISTS fieldmapping" ); $dbh->do( "DELETE FROM user_permissions WHERE code='manage_keywords2koha_mappings'" ); -- 2.11.0