From 52271529c2a16bb8773c4c0c6e911e124e6b8755 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 Content-Type: text/plain; charset=utf-8 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 --- 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 4b3e76f1a8..b01f0727be 100644 --- a/C4/SIP/ILS/Patron.pm +++ b/C4/SIP/ILS/Patron.pm @@ -501,21 +501,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 d7e86eb444..de1c784ea3 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 => 10; +use Test::More tests => 9; 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.30.2