From 1751986e8024cea67ce5d78ad45f8419e9847664 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Wed, 5 Mar 2025 12:45:52 +0000 Subject: [PATCH] Bug 37901: Add updatedatabase information This warning will display if there are existing reports that contain 'pseudonymized_borrower_attributes', informing that these reports need to be updated --- .../data/mysql/atomicupdate/bug_37901.pl | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/installer/data/mysql/atomicupdate/bug_37901.pl b/installer/data/mysql/atomicupdate/bug_37901.pl index 7b772d35917..e2a245bf02e 100755 --- a/installer/data/mysql/atomicupdate/bug_37901.pl +++ b/installer/data/mysql/atomicupdate/bug_37901.pl @@ -1,5 +1,6 @@ use Modern::Perl; use Koha::Installer::Output qw(say_warning say_success say_info); +use Koha::Reports; return { bug_number => "37901", @@ -45,6 +46,29 @@ return { ); } + my $reports = join( + "\n", + map( "\tReport ID: " + . $_->id + . ' | Edit link: ' + . C4::Context->preference('staffClientBaseURL') + . '/cgi-bin/koha/reports/guided_reports.pl?reports=' + . $_->id + . "&phase=Edit%20SQL", + Koha::Reports->search( { savedsql => { -like => "%pseudonymized_borrower_attributes%" } } )->as_list ) + ); + + if ($reports) { + say_warning( + $out, + "Bug 37901: **ACTION REQUIRED**: Saved SQL reports containing occurrences of 'pseudonymized_borrower_attributes' were found. The following reports MUST be updated accordingly ('pseudonymized_borrower_attributes' -> 'pseudonymized_metadata_values', 'code' -> 'key', 'attribute' -> 'value'):" + ); + say_info( + $out, + $reports + ); + } + say_success( $out, "Finished" ); }, }; -- 2.39.5