Bug 11529: (QA follow-up) Copy existing subtitle mappings and warn others

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Nick Clemens 2019-07-26 15:45:51 +00:00 committed by Martin Renvoize
parent 5b1ed49baa
commit 66655602b7
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F

View file

@ -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'" );