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 <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Matt Blenkinsop 2023-06-14 14:15:33 +00:00 committed by Tomas Cohen Arazi
parent 68f1154f6d
commit 2db5afffa1
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
2 changed files with 1 additions and 38 deletions

View File

@ -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;

View File

@ -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;