Bug 42397: Atomicupdate

1) Enable ILLModule and IllLog system preferences.
2) Install a metadata enrichment plugin that supports ILL batches (restart plack if needed), e.g.:
  https://github.com/openfifth/koha-plugin-api-pubmed/releases
3) Visit ILL module:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl
4) Click the 'New ILL requests batch' button
5) Enter any name, cardnumber '42' and any library. Click 'Continue'
6) Add a pubmedid (e.g. '123') and click process identifiers.
7) Click 'Add items to batch' and 'Finish and view batch'.
8) Visit the ILL request we just created:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl?op=illview&illrequest_id=1
9) Confirm it explodes with a nasty 500 error
10) Apply patches, updatedatabase and restart plack.
11) Repeat 8). Confirm it no longer explodes
12) Click' ILL request log'. Confirm it shows the correct log(s) relative to this ILL request
13) Visit the log viewer and query for 'Interlibrary loans':
http://localhost:8081/cgi-bin/koha/tools/viewlog.pl?src=&user=&modules=ILL&actions=&object=&info=&interfaces=&from=&to=&output=screen&basename=Export&report_name=&do_it=1
14) Confirm only ILL requests are shown, do the same for ILL batches:
http://localhost:8081/cgi-bin/koha/tools/viewlog.pl?do_it=1&src=&user=&modules=ILL_BATCHES&actions=&object=&info=&interfaces=&from=&to=&output=screen&basename=Export&report_name=&do_it=1
15) Confirm only ILL batches are shown
16) Run all ILL batch relevant tests:
prove t/db_dependent/Koha/ILL/Batch*

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Pedro Amorim 2026-04-16 11:01:32 +00:00
parent 268b5cbd0e
commit 25bfb77b0b
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,46 @@
use Modern::Perl;
use Koha::Installer::Output qw(say_warning say_success say_info);
return {
bug_number => "42397",
description => "Migrate ILL batch action_logs entries to ILL_BATCHES module",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
my ($count) = $dbh->selectrow_array(
q{
SELECT COUNT(*) FROM action_logs
WHERE module = 'ILL'
AND action IN (
'batch_create',
'batch_update',
'batch_delete',
'batch_status_create',
'batch_status_update',
'batch_status_delete'
)
}
);
if ($count) {
$dbh->do(
q{
UPDATE action_logs
SET module = 'ILL_BATCHES'
WHERE module = 'ILL'
AND action IN (
'batch_create',
'batch_update',
'batch_delete',
'batch_status_create',
'batch_status_update',
'batch_status_delete'
)
}
);
say_success( $out, "Migrated $count action_logs entries from module 'ILL' to 'ILL_BATCHES'" );
}
},
};