Bugzilla – Attachment 164075 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::Config -> Koha::ILL::Request::Config
Bug-35581-KohaIllrequestConfig---KohaILLRequestCon.patch (text/plain), 17.76 KB, created by
Pedro Amorim
on 2024-03-28 16:00:24 UTC
(
hide
)
Description:
Bug 35581: Koha::Illrequest::Config -> Koha::ILL::Request::Config
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-03-28 16:00:24 UTC
Size:
17.76 KB
patch
obsolete
>From daf720c1e1f3eb56ce86b787f04288604463dd08 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Thu, 14 Dec 2023 15:32:56 -0100 >Subject: [PATCH] Bug 35581: Koha::Illrequest::Config -> > Koha::ILL::Request::Config > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > Koha/{Illrequest => ILL/Request}/Config.pm | 8 +-- > Koha/Illrequest.pm | 2 +- > Koha/Illrequests.pm | 4 +- > Koha/REST/V1/ILL/Backends.pm | 2 +- > about.pl | 4 +- > ill/ill-requests.pl | 2 +- > misc/process_ill_updates.pl | 2 +- > opac/opac-illrequests.pl | 4 +- > t/db_dependent/Illrequests.t | 4 +- > t/db_dependent/Koha/ILL/Comments.t | 2 +- > .../{Illrequest => Koha/ILL/Request}/Config.t | 54 +++++++++---------- > t/db_dependent/api/v1/ill_backends.t | 4 +- > t/db_dependent/api/v1/ill_requests.t | 4 +- > 13 files changed, 48 insertions(+), 48 deletions(-) > rename Koha/{Illrequest => ILL/Request}/Config.pm (98%) > rename t/db_dependent/{Illrequest => Koha/ILL/Request}/Config.t (90%) > >diff --git a/Koha/Illrequest/Config.pm b/Koha/ILL/Request/Config.pm >similarity index 98% >rename from Koha/Illrequest/Config.pm >rename to Koha/ILL/Request/Config.pm >index 61220a0eb25..4de76dd6274 100644 >--- a/Koha/Illrequest/Config.pm >+++ b/Koha/ILL/Request/Config.pm >@@ -1,4 +1,4 @@ >-package Koha::Illrequest::Config; >+package Koha::ILL::Request::Config; > > # Copyright 2013,2014 PTFS Europe Ltd > # >@@ -27,7 +27,7 @@ use List::MoreUtils qw( uniq ); > > =head1 NAME > >-Koha::Illrequest::Config - Koha ILL Configuration Object >+Koha::ILL::Request::Config - Koha ILL Configuration Object > > =head1 SYNOPSIS > >@@ -54,9 +54,9 @@ The config file also provides mappings for Record Object accessors. > > =head3 new > >- my $config = Koha::Illrequest::Config->new(); >+ my $config = Koha::ILL::Request::Config->new(); > >-Create a new Koha::Illrequest::Config object, with mapping data loaded from the >+Create a new Koha::ILL::Request::Config object, with mapping data loaded from the > ILL configuration file. > > =cut >diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm >index 06fba923890..24cb10a5fe7 100644 >--- a/Koha/Illrequest.pm >+++ b/Koha/Illrequest.pm >@@ -533,7 +533,7 @@ sub _config { > $self->{_my_config} = $config if ( $config ); > # Load our config object, as late as possible. > unless ( $self->{_my_config} ) { >- $self->{_my_config} = Koha::Illrequest::Config->new; >+ $self->{_my_config} = Koha::ILL::Request::Config->new; > } > return $self->{_my_config}; > } >diff --git a/Koha/Illrequests.pm b/Koha/Illrequests.pm >index 3d2b91237ed..2146c1e491f 100644 >--- a/Koha/Illrequests.pm >+++ b/Koha/Illrequests.pm >@@ -21,7 +21,7 @@ use Modern::Perl; > > use Koha::Database; > use Koha::Illrequest; >-use Koha::Illrequest::Config; >+use Koha::ILL::Request::Config; > > use base qw(Koha::Objects); > >@@ -50,7 +50,7 @@ sub new { > > my $self = $class->SUPER::new($class, $attributes); > >- my $config = Koha::Illrequest::Config->new; # <- Necessary >+ my $config = Koha::ILL::Request::Config->new; # <- Necessary > $self->{_config} = $config; # <- Necessary > > return $self; >diff --git a/Koha/REST/V1/ILL/Backends.pm b/Koha/REST/V1/ILL/Backends.pm >index 58eec04a2cc..d2b78d008c6 100644 >--- a/Koha/REST/V1/ILL/Backends.pm >+++ b/Koha/REST/V1/ILL/Backends.pm >@@ -19,7 +19,7 @@ use Modern::Perl; > > use Mojo::Base 'Mojolicious::Controller'; > >-use Koha::Illrequest::Config; >+use Koha::ILL::Request::Config; > use Koha::Illrequests; > use Koha::ILL::Backend; > >diff --git a/about.pl b/about.pl >index c5f7f73f37d..5ac652b1572 100755 >--- a/about.pl >+++ b/about.pl >@@ -53,7 +53,7 @@ use Koha::Patron::Categories; > use Koha::Patrons; > use Koha::Caches; > use Koha::Config::SysPrefs; >-use Koha::Illrequest::Config; >+use Koha::ILL::Request::Config; > use Koha::SearchEngine::Elasticsearch; > use Koha::Logger; > use Koha::Filter::MARC::ViewPolicy; >@@ -300,7 +300,7 @@ unless ( Koha::I18N->_base_directory ) { > if ( C4::Context->preference('ILLModule') ) { > my $warnILLConfiguration = 0; > my $ill_config_from_file = C4::Context->config("interlibrary_loans"); >- my $ill_config = Koha::Illrequest::Config->new; >+ my $ill_config = Koha::ILL::Request::Config->new; > > my $available_ill_backends = > ( scalar @{ $ill_config->available_backends } > 0 ); >diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl >index e5f7c27c5bf..cfe3df65fc9 100755 >--- a/ill/ill-requests.pl >+++ b/ill/ill-requests.pl >@@ -62,7 +62,7 @@ my ( $template, $patronnumber, $cookie ) = get_template_and_user( { > } ); > > # Are we able to actually work? >-my $cfg = Koha::Illrequest::Config->new; >+my $cfg = Koha::ILL::Request::Config->new; > my $backends = $cfg->available_backends; > my $has_branch = $cfg->has_branch; > my $backends_available = ( scalar @{$backends} > 0 ); >diff --git a/misc/process_ill_updates.pl b/misc/process_ill_updates.pl >index 85b05d2a003..fb2e22544c0 100755 >--- a/misc/process_ill_updates.pl >+++ b/misc/process_ill_updates.pl >@@ -58,7 +58,7 @@ if (!$backend) { > } > > # First check we can proceed >-my $cfg = Koha::Illrequest::Config->new; >+my $cfg = Koha::ILL::Request::Config->new; > my $backends = $cfg->available_backends; > my $has_branch = $cfg->has_branch; > my $backends_available = ( scalar @{$backends} > 0 ); >diff --git a/opac/opac-illrequests.pl b/opac/opac-illrequests.pl >index d9eaebe032d..52e56b883fb 100755 >--- a/opac/opac-illrequests.pl >+++ b/opac/opac-illrequests.pl >@@ -27,7 +27,7 @@ use C4::Koha; > use C4::Output qw( output_html_with_http_headers ); > use POSIX qw( strftime ); > >-use Koha::Illrequest::Config; >+use Koha::ILL::Request::Config; > use Koha::Illrequests; > use Koha::Illrequest; > use Koha::Libraries; >@@ -56,7 +56,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ > > # Are we able to actually work? > my $reduced = C4::Context->preference('ILLOpacbackends'); >-my $backends = Koha::Illrequest::Config->new->available_backends($reduced); >+my $backends = Koha::ILL::Request::Config->new->available_backends($reduced); > my $backends_available = ( scalar @{$backends} > 0 ); > $template->param( backends_available => $backends_available ); > my $patron = Koha::Patrons->find($loggedinuser); >diff --git a/t/db_dependent/Illrequests.t b/t/db_dependent/Illrequests.t >index 3d55467ac8a..538a24c11b5 100755 >--- a/t/db_dependent/Illrequests.t >+++ b/t/db_dependent/Illrequests.t >@@ -23,7 +23,7 @@ use C4::Circulation qw( AddIssue AddReturn ); > > use Koha::Database; > use Koha::ILL::Request::Attributes; >-use Koha::Illrequest::Config; >+use Koha::ILL::Request::Config; > use Koha::Biblios; > use Koha::Patrons; > use Koha::ItemTypes; >@@ -60,7 +60,7 @@ subtest 'Basic object tests' => sub { > > isa_ok($illrq_obj, 'Koha::Illrequest', > "Correctly create and load an illrequest object."); >- isa_ok($illrq_obj->_config, 'Koha::Illrequest::Config', >+ isa_ok($illrq_obj->_config, 'Koha::ILL::Request::Config', > "Created a config object as part of Illrequest creation."); > > is($illrq_obj->illrequest_id, $illrq->{illrequest_id}, >diff --git a/t/db_dependent/Koha/ILL/Comments.t b/t/db_dependent/Koha/ILL/Comments.t >index 0994288333b..dbe1dd2c440 100755 >--- a/t/db_dependent/Koha/ILL/Comments.t >+++ b/t/db_dependent/Koha/ILL/Comments.t >@@ -21,7 +21,7 @@ use File::Basename qw/basename/; > use Koha::Database; > use Koha::Illrequests; > use Koha::ILL::Request::Attributes; >-use Koha::Illrequest::Config; >+use Koha::ILL::Request::Config; > use Koha::Patrons; > use t::lib::Mocks; > use t::lib::TestBuilder; >diff --git a/t/db_dependent/Illrequest/Config.t b/t/db_dependent/Koha/ILL/Request/Config.t >similarity index 90% >rename from t/db_dependent/Illrequest/Config.t >rename to t/db_dependent/Koha/ILL/Request/Config.t >index 1034abbec20..f511726c308 100755 >--- a/t/db_dependent/Illrequest/Config.t >+++ b/t/db_dependent/Koha/ILL/Request/Config.t >@@ -27,7 +27,7 @@ use Test::More tests => 5; > > my $schema = Koha::Database->new->schema; > my $builder = t::lib::TestBuilder->new; >-use_ok('Koha::Illrequest::Config'); >+use_ok('Koha::ILL::Request::Config'); > > my $base_limits = { > branch => { CPL => { count => 1, method => 'annual' } }, >@@ -46,8 +46,8 @@ subtest 'Basics' => sub { > t::lib::Mocks::mock_config("interlibrary_loans", {}); > t::lib::Mocks::mock_preference('ILLPartnerCode', undef); > >- my $config = Koha::Illrequest::Config->new; >- isa_ok($config, "Koha::Illrequest::Config", >+ my $config = Koha::ILL::Request::Config->new; >+ isa_ok($config, "Koha::ILL::Request::Config", > "Correctly create and load a config object."); > > # backend: >@@ -98,22 +98,22 @@ subtest '_load_unit_config' => sub { > > $schema->storage->txn_begin; > >- my $config = Koha::Illrequest::Config->new; >+ my $config = Koha::ILL::Request::Config->new; > > dies_ok( >- sub { Koha::Illrequest::Config::_load_unit_config({ >+ sub { Koha::ILL::Request::Config::_load_unit_config({ > id => 'durineadu', type => 'baz' > }) }, > "_load_unit_config: die if ID is not default, and type is not branch or brw_cat." > ); > is_deeply( >- Koha::Illrequest::Config::_load_unit_config({ >+ Koha::ILL::Request::Config::_load_unit_config({ > unit => {}, id => 'default', config => {}, test => 1 > }), {}, "_load_unit_config: invocation without id returns unmodified config." > ); > > is_deeply( >- Koha::Illrequest::Config::_load_unit_config({ >+ Koha::ILL::Request::Config::_load_unit_config({ > unit => { api_key => 'foo', api_auth => 'bar' }, > id => "CPL", type => 'branch', config => {} > }), >@@ -123,19 +123,19 @@ subtest '_load_unit_config' => sub { > > # Populate request_limits > is_deeply( >- Koha::Illrequest::Config::_load_unit_config({ >+ Koha::ILL::Request::Config::_load_unit_config({ > unit => { request_limit => [ 'heelo', 1234 ] }, > id => "CPL", type => 'branch', config => {} > }), {}, "_load_unit_config: invalid request_limit structure." > ); > is_deeply( >- Koha::Illrequest::Config::_load_unit_config({ >+ Koha::ILL::Request::Config::_load_unit_config({ > unit => { request_limit => { method => 'eudiren', count => '-5465' } }, > id => "CPL", type => 'branch', config => {} > }), {}, "_load_unit_config: invalid method & count." > ); > is_deeply( >- Koha::Illrequest::Config::_load_unit_config({ >+ Koha::ILL::Request::Config::_load_unit_config({ > unit => { request_limit => { method => 'annual', count => 6 } }, > id => "default", config => {} > }), >@@ -145,7 +145,7 @@ subtest '_load_unit_config' => sub { > > # Populate prefix > is_deeply( >- Koha::Illrequest::Config::_load_unit_config({ >+ Koha::ILL::Request::Config::_load_unit_config({ > unit => { prefix => 'Foo-ill' }, > id => "default", config => {} > }), >@@ -153,7 +153,7 @@ subtest '_load_unit_config' => sub { > "_load_unit_config: correct default prefix." > ); > is_deeply( >- Koha::Illrequest::Config::_load_unit_config({ >+ Koha::ILL::Request::Config::_load_unit_config({ > unit => { prefix => 'Foo-ill' }, > id => "A", config => {}, type => 'brw_cat' > }), >@@ -163,7 +163,7 @@ subtest '_load_unit_config' => sub { > > # Populate digital_recipient > is_deeply( >- Koha::Illrequest::Config::_load_unit_config({ >+ Koha::ILL::Request::Config::_load_unit_config({ > unit => { digital_recipient => 'borrower' }, > id => "default", config => {} > }), >@@ -171,7 +171,7 @@ subtest '_load_unit_config' => sub { > "_load_unit_config: correct default digital_recipient." > ); > is_deeply( >- Koha::Illrequest::Config::_load_unit_config({ >+ Koha::ILL::Request::Config::_load_unit_config({ > unit => { digital_recipient => 'branch' }, > id => "A", config => {}, type => 'brw_cat' > }), >@@ -198,12 +198,12 @@ subtest '_load_configuration' => sub { > > $schema->storage->txn_begin; > >- my $config = Koha::Illrequest::Config->new; >+ my $config = Koha::ILL::Request::Config->new; > t::lib::Mocks::mock_preference('ILLPartnerCode', 'IL'); > > # Return basic configuration > is_deeply( >- Koha::Illrequest::Config::_load_configuration({}, 0), >+ Koha::ILL::Request::Config::_load_configuration( {}, 0 ), > { > backend_directory => undef, > censorship => { >@@ -221,7 +221,7 @@ subtest '_load_configuration' => sub { > > # Return correct backend_dir > is_deeply( >- Koha::Illrequest::Config::_load_configuration({ backend_directory => '/tmp/' }, 0), >+ Koha::ILL::Request::Config::_load_configuration( { backend_directory => '/tmp/' }, 0 ), > { > backend_directory => '/tmp/', > censorship => { >@@ -247,7 +247,7 @@ subtest '_load_configuration' => sub { > ] > }; > is_deeply( >- Koha::Illrequest::Config::_load_configuration($xml_config, 0), >+ Koha::ILL::Request::Config::_load_configuration( $xml_config, 0 ), > { > backend_directory => '/tmp/', > censorship => { >@@ -273,7 +273,7 @@ subtest '_load_configuration' => sub { > } > }; > is_deeply( >- Koha::Illrequest::Config::_load_configuration($xml_config, 0), >+ Koha::ILL::Request::Config::_load_configuration( $xml_config, 0 ), > { > backend_directory => '/tmp/', > censorship => { >@@ -299,7 +299,7 @@ subtest '_load_configuration' => sub { > ] > }; > is_deeply( >- Koha::Illrequest::Config::_load_configuration($xml_config, 0), >+ Koha::ILL::Request::Config::_load_configuration( $xml_config, 0 ), > { > backend_directory => '/tmp/', > censorship => { >@@ -325,7 +325,7 @@ subtest '_load_configuration' => sub { > } > }; > is_deeply( >- Koha::Illrequest::Config::_load_configuration($xml_config, 0), >+ Koha::ILL::Request::Config::_load_configuration( $xml_config, 0 ), > { > backend_directory => '/tmp/', > censorship => { >@@ -349,7 +349,7 @@ subtest '_load_configuration' => sub { > digital_recipient => 'branch', > }; > is_deeply( >- Koha::Illrequest::Config::_load_configuration($xml_config, 0), >+ Koha::ILL::Request::Config::_load_configuration( $xml_config, 0 ), > { > backend_directory => '/tmp/', > censorship => { >@@ -372,7 +372,7 @@ subtest '_load_configuration' => sub { > reply_date => 'hide' > }; > is_deeply( >- Koha::Illrequest::Config::_load_configuration($xml_config, 0), >+ Koha::ILL::Request::Config::_load_configuration( $xml_config, 0 ), > { > backend_directory => '/tmp/', > censorship => { >@@ -390,7 +390,7 @@ subtest '_load_configuration' => sub { > > # Partner library category > is_deeply( >- Koha::Illrequest::Config::_load_configuration( { partner_code => 'FOOBAR' } ), >+ Koha::ILL::Request::Config::_load_configuration( { partner_code => 'FOOBAR' } ), > { > backend_directory => undef, > censorship => { >@@ -409,7 +409,7 @@ subtest '_load_configuration' => sub { > t::lib::Mocks::mock_preference( 'ILLPartnerCode', 'FOOBAR' ); > > is_deeply( >- Koha::Illrequest::Config::_load_configuration(), >+ Koha::ILL::Request::Config::_load_configuration(), > { > backend_directory => undef, > censorship => { >@@ -437,7 +437,7 @@ subtest 'Final tests' => sub { > > t::lib::Mocks::mock_config("interlibrary_loans", {}); > >- my $config = Koha::Illrequest::Config->new; >+ my $config = Koha::ILL::Request::Config->new; > > # getPrefixes (error & undef): > is($config->getPrefixes(), undef, >@@ -453,7 +453,7 @@ subtest 'Final tests' => sub { > is_deeply($config->getDigitalRecipients("branch"), { default => undef}, > "getDigitalRecipients: Undefined branch dig rec is undefined."); > >- $config->{configuration} = Koha::Illrequest::Config::_load_configuration({ >+ $config->{configuration} = Koha::ILL::Request::Config::_load_configuration({ > backend_directory => '/tmp/', > prefix => 'DEFAULT-prefix', > digital_recipient => 'branch', >diff --git a/t/db_dependent/api/v1/ill_backends.t b/t/db_dependent/api/v1/ill_backends.t >index 44270cf83d8..ded2424fc10 100755 >--- a/t/db_dependent/api/v1/ill_backends.t >+++ b/t/db_dependent/api/v1/ill_backends.t >@@ -40,8 +40,8 @@ subtest 'list() tests' => sub { > > plan tests => 16; > >- # Mock Illrequest::Config (as module) >- my $illconfig_module = Test::MockModule->new('Koha::Illrequest::Config'); >+ # Mock ILL::Request::Config (as module) >+ my $illconfig_module = Test::MockModule->new('Koha::ILL::Request::Config'); > > # Start with no backends installed > $illconfig_module->mock( 'available_backends', sub { () } ); >diff --git a/t/db_dependent/api/v1/ill_requests.t b/t/db_dependent/api/v1/ill_requests.t >index 7822acc4863..9745c5cf917 100755 >--- a/t/db_dependent/api/v1/ill_requests.t >+++ b/t/db_dependent/api/v1/ill_requests.t >@@ -217,10 +217,10 @@ subtest 'list() tests' => sub { > ->json_has('/0/comments', $comment_text); > > # x-koha-embed: id_prefix >- # Mock Illrequest::Config to return a static prefix >+ # Mock ILL::Request::Config to return a static prefix > my $id_prefix = 'ILL'; > my $config = Test::MockObject->new; >- $config->set_isa('Koha::Illrequest::Config::Mock'); >+ $config->set_isa('Koha::ILL::Request::Config::Mock'); > $config->set_always('getPrefixes', $id_prefix); > > # Make sure id_prefix comes back >-- >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