Bug 28633: DBRev 24.06.00.058

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Katrin Fischer 2024-11-11 11:05:46 +00:00
parent b54850fc29
commit 7712afaea9
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 11 additions and 7 deletions

View File

@ -29,7 +29,7 @@ use vars qw{ $VERSION };
# - #4 : the developer version. The 4th number is the database subversion.
# used by developers when the database changes. updatedatabase take care of the changes itself
# and is automatically called by Auth.pm when needed.
$VERSION = "24.06.00.057";
$VERSION = "24.06.00.058";
sub version {
return $VERSION;

View File

@ -1,4 +1,5 @@
use Modern::Perl;
use Koha::Installer::Output qw(say_warning say_success say_info);
return {
bug_number => "28633",
@ -15,7 +16,7 @@ return {
AFTER firstname
}
);
say $out "Added column 'borrowers.preferred_name'";
say_success( $out, "Added column 'borrowers.preferred_name'" );
}
if ( !column_exists( 'deletedborrowers', 'preferred_name' ) ) {
$dbh->do(
@ -26,7 +27,7 @@ return {
AFTER firstname
}
);
say $out "Added column 'deletedborrowers.preferred_name'";
say_success( $out, "Added column 'deletedborrowers.preferred_name'" );
}
if ( !column_exists( 'borrower_modifications', 'preferred_name' ) ) {
$dbh->do(
@ -37,16 +38,19 @@ return {
AFTER firstname
}
);
say $out "Added column 'borrower_modifications.preferred_name'";
say_success( $out, "Added column 'borrower_modifications.preferred_name'" );
}
my @default_patron_search_fields = split( '\|', C4::Context->preference('DefaultPatronSearchFields') );
unless ( grep /preferred_name/, @default_patron_search_fields ) {
if ( grep /firstname/, @default_patron_search_fields ) {
push @default_patron_search_fields, 'preferred_name';
C4::Context->set_preference( 'DefaultPatronSearchFields', join( '|', @default_patron_search_fields ) );
say $out "Added 'preferred_name' to DefaultPatronSearchFields";
say_info( $out, "Added 'preferred_name' to DefaultPatronSearchFields" );
} else {
say $out "Please add 'preferred_name' to DefaultPatronSearchFields if you want it searched by default";
say_info(
$out,
"Please add 'preferred_name' to 'DefaultPatronSearchFields' if you want it searched by default"
);
}
}
$dbh->do(
@ -56,6 +60,6 @@ return {
WHERE preferred_name IS NULL
}
);
say $out "Initially set preferred_name to firstname";
say_success( $out, "Initially set 'preferred_name' to 'firstname'" );
},
}