From 2db5afffa17de0b7ba24232ca32d73ffe1ca516c Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Wed, 14 Jun 2023 14:15:33 +0000 Subject: [PATCH] Bug 15504: Remove update_lastseen method This patch removes update_lastseen which has been replaced by a call to track_login_daily Signed-off-by: Martin Renvoize Signed-off-by: David Nind Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- C4/SIP/ILS/Patron.pm | 15 --------------- t/db_dependent/SIP/Patron.t | 24 +----------------------- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/C4/SIP/ILS/Patron.pm b/C4/SIP/ILS/Patron.pm index 5365860b7d..9bcb1c0124 100644 --- a/C4/SIP/ILS/Patron.pm +++ b/C4/SIP/ILS/Patron.pm @@ -523,21 +523,6 @@ sub charge_denied { return "Please contact library staff"; } -=head2 update_lastseen - - $patron->update_lastseen(); - - Patron method to update lastseen field in borrower - to record that patron has been seen via sip connection - -=cut - -sub update_lastseen { - my $self = shift; - my $kohaobj = Koha::Patrons->find( $self->{borrowernumber} ); - $kohaobj->track_login if $kohaobj; # track_login checks the pref -} - sub _get_address { my $patron = shift; diff --git a/t/db_dependent/SIP/Patron.t b/t/db_dependent/SIP/Patron.t index 560c322bf4..cb7dba5c15 100755 --- a/t/db_dependent/SIP/Patron.t +++ b/t/db_dependent/SIP/Patron.t @@ -4,7 +4,7 @@ # This needs to be extended! Your help is appreciated.. use Modern::Perl; -use Test::More tests => 11; +use Test::More tests => 12; use t::lib::Mocks; use t::lib::TestBuilder; @@ -188,28 +188,6 @@ subtest "Test build_custom_field_string" => sub { }; -subtest "update_lastseen tests" => sub { - plan tests => 2; - - my $seen_patron = $builder->build( - { - source => 'Borrower', - value => { - lastseen => "2001-01-01", - } - } - ); - my $sip_patron = C4::SIP::ILS::Patron->new( $seen_patron->{cardnumber} ); - t::lib::Mocks::mock_preference( 'TrackLastPatronActivity', '' ); - $sip_patron->update_lastseen(); - $seen_patron = Koha::Patrons->find({ cardnumber => $seen_patron->{cardnumber} }); - is( output_pref({str => $seen_patron->lastseen(), dateonly => 1}), output_pref({str => '2001-01-01', dateonly => 1}),'Last seen not updated if not tracking patrons'); - t::lib::Mocks::mock_preference( 'TrackLastPatronActivity', '1' ); - $sip_patron->update_lastseen(); - $seen_patron = Koha::Patrons->find({ cardnumber => $seen_patron->cardnumber() }); - is( output_pref({str => $seen_patron->lastseen(), dateonly => 1}), output_pref({dt => dt_from_string(), dateonly => 1}),'Last seen updated to today if tracking patrons'); -}; - subtest "fine_items tests" => sub { plan tests => 12; -- 2.39.5