Bugzilla – Attachment 164076 Details for
Bug 35581
ILL Koha classes are not consistent
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35581: Koha::Illrequest::Logger -> Koha::ILL::Request::Logger
Bug-35581-KohaIllrequestLogger---KohaILLRequestLog.patch (text/plain), 9.55 KB, created by
Pedro Amorim
on 2024-03-28 16:00:28 UTC
(
hide
)
Description:
Bug 35581: Koha::Illrequest::Logger -> Koha::ILL::Request::Logger
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-03-28 16:00:28 UTC
Size:
9.55 KB
patch
obsolete
>From 85eab918cc1f8dcddda301a3ae2a5d0f0206f8ad Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Thu, 14 Dec 2023 17:07:23 +0000 >Subject: [PATCH] Bug 35581: Koha::Illrequest::Logger -> > Koha::ILL::Request::Logger > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > Koha/ILL/Batch.pm | 8 ++++---- > Koha/ILL/Batch/Status.pm | 8 ++++---- > Koha/{Illrequest => ILL/Request}/Logger.pm | 18 +++++++++--------- > Koha/Illrequest.pm | 16 ++++++++-------- > t/db_dependent/Koha/ILL/Batch/Statuses.t | 2 +- > .../{Illrequest => Koha/ILL/Request}/Logger.t | 6 +++--- > 6 files changed, 29 insertions(+), 29 deletions(-) > rename Koha/{Illrequest => ILL/Request}/Logger.pm (93%) > rename t/db_dependent/{Illrequest => Koha/ILL/Request}/Logger.t (95%) > >diff --git a/Koha/ILL/Batch.pm b/Koha/ILL/Batch.pm >index d5aa7955fe7..76330dd51cd 100644 >--- a/Koha/ILL/Batch.pm >+++ b/Koha/ILL/Batch.pm >@@ -22,7 +22,7 @@ use Modern::Perl; > use Koha::Database; > > use Koha::Illrequests; >-use Koha::Illrequest::Logger; >+use Koha::ILL::Request::Logger; > use Koha::ILL::Batch::Statuses; > use Koha::Libraries; > use Koha::Patrons; >@@ -104,7 +104,7 @@ sub create_and_log { > > $self->store; > >- my $logger = Koha::Illrequest::Logger->new; >+ my $logger = Koha::ILL::Request::Logger->new; > > $logger->log_something( > { >@@ -140,7 +140,7 @@ sub update_and_log { > library_id => $self->library_id, > }; > >- my $logger = Koha::Illrequest::Logger->new; >+ my $logger = Koha::ILL::Request::Logger->new; > > $logger->log_something( > { >@@ -168,7 +168,7 @@ Log batch delete > sub delete_and_log { > my ($self) = @_; > >- my $logger = Koha::Illrequest::Logger->new; >+ my $logger = Koha::ILL::Request::Logger->new; > > $logger->log_something( > { >diff --git a/Koha/ILL/Batch/Status.pm b/Koha/ILL/Batch/Status.pm >index 6f49f618c4d..b13efd4a1cb 100644 >--- a/Koha/ILL/Batch/Status.pm >+++ b/Koha/ILL/Batch/Status.pm >@@ -19,7 +19,7 @@ package Koha::ILL::Batch::Status; > > use Modern::Perl; > use Koha::Database; >-use Koha::Illrequest::Logger; >+use Koha::ILL::Request::Logger; > use Koha::ILL::Batch; > use JSON qw( to_json ); > use base qw(Koha::Object); >@@ -59,7 +59,7 @@ sub create_and_log { > } > )->store; > >- my $logger = Koha::Illrequest::Logger->new; >+ my $logger = Koha::ILL::Request::Logger->new; > > $logger->log_something( > { >@@ -90,7 +90,7 @@ sub update_and_log { > > my $after = { name => $self->name }; > >- my $logger = Koha::Illrequest::Logger->new; >+ my $logger = Koha::ILL::Request::Logger->new; > > $logger->log_something( > { >@@ -127,7 +127,7 @@ sub delete_and_log { > my $affected = Koha::ILL::Batches->search( { status_code => $self->code } ); > $affected->update( { status_code => 'UNKNOWN' } ); > >- my $logger = Koha::Illrequest::Logger->new; >+ my $logger = Koha::ILL::Request::Logger->new; > > $logger->log_something( > { >diff --git a/Koha/Illrequest/Logger.pm b/Koha/ILL/Request/Logger.pm >similarity index 93% >rename from Koha/Illrequest/Logger.pm >rename to Koha/ILL/Request/Logger.pm >index 6aff15765d0..dbd2703c44d 100644 >--- a/Koha/Illrequest/Logger.pm >+++ b/Koha/ILL/Request/Logger.pm >@@ -1,4 +1,4 @@ >-package Koha::Illrequest::Logger; >+package Koha::ILL::Request::Logger; > > # Copyright 2018 PTFS Europe Ltd > # >@@ -29,7 +29,7 @@ use Koha::Notice::Template; > > =head1 NAME > >-Koha::Illrequest::Logger - Koha ILL Action / Event logger >+Koha::ILL::ILL::Request::Logger - Koha ILL Action / Event logger > > =head1 SYNOPSIS > >@@ -47,9 +47,9 @@ relating to Illrequest to the action log. > > =head3 new > >- my $config = Koha::Illrequest::Logger->new(); >+ my $config = Koha::ILL::Request::Logger->new(); > >-Create a new Koha::Illrequest::Logger object. >+Create a new Koha::ILL::Request::Logger object . > We also set up what can be logged, how to do it and how to display > log entries we get back out > >@@ -84,7 +84,7 @@ sub new { > > =head3 log_maybe > >- Koha::IllRequest::Logger->log_maybe($params); >+ Koha::ILL::Request::Logger->log_maybe($params); > > Receive params hashref, containing a request object and an attrs > hashref (which may or may not be defined) If the attrs hashref contains >@@ -109,7 +109,7 @@ sub log_maybe { > > =head3 log_patron_notice > >- Koha::IllRequest::Logger->log_patron_notice($params); >+ Koha::ILL::Request::Logger->log_patron_notice($params); > > Receive a hashref containing a request object and params to log, > and log it >@@ -134,7 +134,7 @@ sub log_patron_notice { > > =head3 log_status_change > >- Koha::IllRequest::Logger->log_status_change($params); >+ Koha::ILL::Request::Logger->log_status_change($params); > > Receive a hashref containing a request object and a status to log, > and log it >@@ -160,7 +160,7 @@ sub log_status_change { > > =head3 log_something > >- Koha::IllRequest::Logger->log_something({ >+ Koha::ILL::Request::Logger->log_something({ > modulename => 'ILL', > actionname => 'STATUS_CHANGE', > objectnumber => $req->id, >@@ -226,7 +226,7 @@ sub get_log_template { > > =head3 get_request_logs > >- $requestlogs = Koha::IllRequest::Logger->get_request_logs($request_id); >+ $requestlogs = Koha::ILL::Request::Logger->get_request_logs($request_id); > > Get all logged actions for a given request > >diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm >index 24cb10a5fe7..a69383104c3 100644 >--- a/Koha/Illrequest.pm >+++ b/Koha/Illrequest.pm >@@ -33,7 +33,7 @@ use Koha::Exceptions::Ill; > use Koha::ILL::Comments; > use Koha::ILL::Request::Attributes; > use Koha::AuthorisedValue; >-use Koha::Illrequest::Logger; >+use Koha::ILL::Request::Logger; > use Koha::Patron; > use Koha::ILL::Batches; > use Koha::AuthorisedValues; >@@ -234,7 +234,7 @@ sub comments { > > sub logs { > my ( $self ) = @_; >- my $logger = Koha::Illrequest::Logger->new; >+ my $logger = Koha::ILL::Request::Logger->new; > return $logger->get_request_logs($self); > } > >@@ -317,7 +317,7 @@ sub status_alias { > my $ret = $self->SUPER::status_alias($val); > my $val_to_log = $val ? $new_status_alias : scalar $self->status; > if ($ret) { >- my $logger = Koha::Illrequest::Logger->new; >+ my $logger = Koha::ILL::Request::Logger->new; > $logger->log_status_change({ > request => $self, > value => $val_to_log >@@ -379,7 +379,7 @@ sub status { > # so we pass -1, which is special cased in the overloaded setter > $self->status_alias("-1"); > } else { >- my $logger = Koha::Illrequest::Logger->new; >+ my $logger = Koha::ILL::Request::Logger->new; > $logger->log_status_change({ > request => $self, > value => $new_status >@@ -441,7 +441,7 @@ sub load_backend { > $self->{_my_backend} = $backend_plugin->new_ill_backend( > { > config => $self->_config, >- logger => Koha::Illrequest::Logger->new >+ logger => Koha::ILL::Request::Logger->new > } > ); > } elsif ($backend_name) { >@@ -454,7 +454,7 @@ sub load_backend { > $self->{_my_backend} = $backend_class->new( > { > config => $self->_config, >- logger => Koha::Illrequest::Logger->new >+ logger => Koha::ILL::Request::Logger->new > } > ); > } >@@ -1702,7 +1702,7 @@ sub send_patron_notice { > } > } > if (scalar @success > 0) { >- my $logger = Koha::Illrequest::Logger->new; >+ my $logger = Koha::ILL::Request::Logger->new; > $logger->log_patron_notice({ > request => $self, > notice_code => $notice_code >@@ -1948,7 +1948,7 @@ sub store { > $attrs->{log_origin} = 'core'; > > if ($ret && defined $attrs) { >- my $logger = Koha::Illrequest::Logger->new; >+ my $logger = Koha::ILL::Request::Logger->new; > $logger->log_maybe({ > request => $self, > attrs => $attrs >diff --git a/t/db_dependent/Koha/ILL/Batch/Statuses.t b/t/db_dependent/Koha/ILL/Batch/Statuses.t >index 987c1c9e24f..80052ee40ae 100755 >--- a/t/db_dependent/Koha/ILL/Batch/Statuses.t >+++ b/t/db_dependent/Koha/ILL/Batch/Statuses.t >@@ -47,7 +47,7 @@ my $effects = { > }; > > # Mock a logger so we can check it is called >-my $logger = Test::MockModule->new('Koha::Illrequest::Logger'); >+my $logger = Test::MockModule->new('Koha::ILL::Request::Logger'); > $logger->mock( > 'log_something', > sub { >diff --git a/t/db_dependent/Illrequest/Logger.t b/t/db_dependent/Koha/ILL/Request/Logger.t >similarity index 95% >rename from t/db_dependent/Illrequest/Logger.t >rename to t/db_dependent/Koha/ILL/Request/Logger.t >index 07d4097573d..8fc5e7fb8fc 100755 >--- a/t/db_dependent/Illrequest/Logger.t >+++ b/t/db_dependent/Koha/ILL/Request/Logger.t >@@ -34,7 +34,7 @@ my $c4_tpl = Test::MockModule->new('C4::Templates'); > $c4_tpl->mock('_get_template_file', > sub { return ('htdocs', 'theme', 'lang', 'base/'); }); > >-use_ok('Koha::Illrequest::Logger'); >+use_ok('Koha::ILL::Request::Logger'); > > subtest 'Basics' => sub { > >@@ -42,12 +42,12 @@ subtest 'Basics' => sub { > > $schema->storage->txn_begin; > >- my $logger = Koha::Illrequest::Logger->new; >+ my $logger = Koha::ILL::Request::Logger->new; > > # new() > # > ok( defined($logger), 'new() returned something' ); >- ok( $logger->isa('Koha::Illrequest::Logger'), >+ ok( $logger->isa('Koha::ILL::Request::Logger'), > 'new() returns the correct object' ); > > # This is an incomplete data hashref, we use it to >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35581
:
159863
|
159864
|
159865
|
159866
|
159867
|
159868
|
159869
|
159870
|
159871
|
159872
|
159873
|
160422
|
160423
|
160424
|
160425
|
160426
|
160427
|
160428
|
160429
|
160430
|
160431
|
160432
|
160620
|
160622
|
162020
|
162021
|
162022
|
162023
|
162024
|
162025
|
162026
|
162027
|
162028
|
162029
|
162030
|
162031
|
162032
|
162817
|
162818
|
162819
|
162820
|
162821
|
162822
|
162823
|
162824
|
162825
|
162826
|
162827
|
162828
|
162829
|
162880
|
162881
|
162882
|
162883
|
162884
|
162885
|
162886
|
162887
|
162888
|
162889
|
162890
|
162891
|
162892
|
163803
|
163804
|
163805
|
163806
|
163807
|
163808
|
163809
|
163810
|
163811
|
163812
|
163813
|
163814
|
163815
|
163816
|
164069
|
164070
|
164071
|
164072
|
164073
|
164074
|
164075
| 164076 |
164077
|
164078
|
164079
|
164080
|
164081
|
164082
|
165448