[GIT] Evergreen ILS branch rel_3_15 updated. 6524cc9a9161c299f82188770e65b9ed37742f2b

This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Evergreen ILS". The branch, rel_3_15 has been updated via 6524cc9a9161c299f82188770e65b9ed37742f2b (commit) via aac56d85fa7dc40cf4530bb70db97982b33b92c5 (commit) from ccd6c66887918be361a0621f9ea20c5374048c9b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6524cc9a9161c299f82188770e65b9ed37742f2b Author: Jane Sandberg <sandbergja@gmail.com> Date: Mon Jun 2 19:12:05 2025 -0700 LP#2112185 follow-up: add a live test We don't want to see this particular regression again! Signed-off-by: Jane Sandberg <sandbergja@gmail.com> diff --git a/Open-ILS/src/perlmods/live_t/lp2112185-fix-precat-checkout.t b/Open-ILS/src/perlmods/live_t/lp2112185-fix-precat-checkout.t new file mode 100644 index 0000000000..267dc8b339 --- /dev/null +++ b/Open-ILS/src/perlmods/live_t/lp2112185-fix-precat-checkout.t @@ -0,0 +1,82 @@ +#!perl +use strict; use warnings; +use Test::More tests => 7; +use OpenILS::Utils::TestUtils; + +diag 'LP2112185: Precat items must be able to check out multiple times'; + +use constant WORKSTATION_NAME => 'BR4-test-lp2112185-fix-precat-checkout.t'; +use constant WORKSTATION_LIB => 7; # BR4 +use constant BR4_PATRON_ID => 14; # Robert Wade +use constant ITEM_BARCODE => 'μῆνιν ἄειδε θεὰ Πηληϊάδεω Ἀχιλῆος'; # This barcode should not exist in the test data hahaha + +my $script = OpenILS::Utils::TestUtils->new; +$script->bootstrap; + +my $authtoken = $script->authenticate({ + username=>'admin', + password=>'demo123', + type=>'staff' +}); +ok( + $script->authtoken, + 'Have an authtoken' +); + +my $ws = $script->find_or_register_workstation(WORKSTATION_NAME, WORKSTATION_LIB); +ok( + ! ref $ws, + 'Found or registered workstation' +); + +# Login again, this time with the appropriate workstation +$script->authenticate({ + username => 'admin', + password => 'demo123', + type => 'staff', + workstation => WORKSTATION_NAME +}); + +my $checkout_resp = $script->do_checkout({ + patron => BR4_PATRON_ID, + barcode => ITEM_BARCODE +}); +is $checkout_resp->{textcode}, + 'ITEM_NOT_CATALOGED', + 'It tells you that the item is not cataloged'; + + +$checkout_resp = $script->do_checkout({ + patron => BR4_PATRON_ID, + barcode => ITEM_BARCODE, + dummy_title => 'my title', + precat => 1 +}); +is $checkout_resp->{textcode}, + 'SUCCESS', + 'It can check out a precat if you pass precat => 1'; + +my $checkin_resp = $script->do_checkin({ + copy_barcode => ITEM_BARCODE +}); +is $checkin_resp->{textcode}, + 'ITEM_NOT_CATALOGED', + 'It lets the client know that it is a precat, so the client can tell the user to route to cataloging'; + +$checkout_resp = $script->do_checkout({ + patron => BR4_PATRON_ID, + barcode => ITEM_BARCODE, + dummy_title => 'my title', + precat => 1 +}); +is $checkout_resp->{textcode}, + 'SUCCESS', + 'You can check out a precat with the same barcode again'; + +$checkin_resp = $script->do_checkin({ + copy_barcode => ITEM_BARCODE +}); +is $checkin_resp->{textcode}, + 'ITEM_NOT_CATALOGED', + 'The second time you check it in, it still lets you know that it is a precat'; + commit aac56d85fa7dc40cf4530bb70db97982b33b92c5 Author: Mike Rylander <mrylander@gmail.com> Date: Fri May 30 10:47:46 2025 -0400 LP#2112185: Bring back core precat behavior The fix proposed and committed for LP bug 2098898 removed all precat event overrides in an attempt to stop blocked patrons from receiving precat items at checkout. Unfortunately, the precat mechanism uses the automatic COPY_NOT_AVAILABLE.override permission check to see if staff are allowed to check out a precat that has circulated in the past. This commit brings back the override check for that specific COPY_NOT_AVAILALBE event, allowing precats to properly circulate again. Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Ruth Frasur Davis <rfrasur@gmail.com> Signed-off-by: Jane Sandberg <sandbergja@gmail.com> diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm index c312d0a592..9755d03868 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -161,7 +161,7 @@ __PACKAGE__->register_method( sub run_method { my( $self, $conn, $auth, $args ) = @_; translate_legacy_args($args); - $args->{override_args} = { all => 1 } unless defined $args->{override_args}; + $args->{override_args} = { all => 1, events => [] } unless defined $args->{override_args}; $args->{new_copy_alerts} ||= $self->api_level > 1 ? 1 : 0; my $api = $self->api_name; @@ -248,6 +248,11 @@ sub run_method { } elsif( $api =~ /checkout.full/ ) { $circulator->skip_permit_key(1); + if ( $circulator->request_precat && $circulator->editor->allowed('CREATE_PRECAT') ) { + $circulator->override(1); + $circulator->override_args->{all} = 0; # precat checkout should only override COPY_NOT_AVAILABLE, and whatever else the client requested + push @{$circulator->override_args->{events}}, 'COPY_NOT_AVAILABLE'; + } $circulator->do_permit(); $circulator->is_checkout(1); unless( $circulator->bail_out ) { ----------------------------------------------------------------------- Summary of changes: .../lib/OpenILS/Application/Circ/Circulate.pm | 7 +- .../live_t/lp2112185-fix-precat-checkout.t | 82 ++++++++++++++++++++++ 2 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/perlmods/live_t/lp2112185-fix-precat-checkout.t hooks/post-receive -- Evergreen ILS
participants (1)
-
Git User