Bug 38284: Add patron check for TrackLastPatronActivityTriggers

If an invalid or empty cardnumber is supplied to patron status request SIP message, SIP dies silently and no 'READ:' exists on the response.

Test plan:
1) Apply tests plan, run tests:
$ prove t/db_dependent/SIP/Message.t
2) Verify tests fail. Apply 2nd patch. Run tests again. Verify they pass.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Pedro Amorim 2024-10-29 09:24:36 +00:00 committed by Katrin Fischer
parent 5acf88d91d
commit 87256d7ae3
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 1 additions and 1 deletions

View File

@ -504,7 +504,7 @@ sub handle_patron_status {
$ils->check_inst_id( $fields->{ (FID_INST_ID) }, "handle_patron_status" );
$patron = $ils->find_patron( $fields->{ (FID_PATRON_ID) } );
if ( C4::Context->preference('TrackLastPatronActivityTriggers') ) {
if ( C4::Context->preference('TrackLastPatronActivityTriggers') && $patron ) {
my $koha_patron = Koha::Patrons->find($patron->{borrowernumber});
$koha_patron->update_lastseen('connection');
}