Bugzilla – Attachment 163807 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::Illrequestattribute* -> Koha::ILL::Request::Attribute*
Bug-35581-KohaIllrequestattribute---KohaILLRequest.patch (text/plain), 8.51 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-03-25 13:28:55 UTC
(
hide
)
Description:
Bug 35581: Koha::Illrequestattribute* -> Koha::ILL::Request::Attribute*
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-03-25 13:28:55 UTC
Size:
8.51 KB
patch
obsolete
>From 735113951663dc4cbf99bfbea6b793ae07ffd635 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Thu, 14 Dec 2023 15:02:05 -0100 >Subject: [PATCH] Bug 35581: Koha::Illrequestattribute* -> > Koha::ILL::Request::Attribute* > >Koha/Illrequestattribute.pm -> Koha/ILL/Request/Attribute.pm >Koha/Illrequestattributes.pm -> Koha/ILL/Request/Attributes.pm > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../Request/Attribute.pm} | 6 +++--- > .../Request/Attributes.pm} | 10 +++++----- > Koha/Illrequest.pm | 10 +++++----- > Koha/REST/V1/Illrequests.pm | 2 +- > Koha/Schema/Result/Illrequestattribute.pm | 8 ++++++++ > t/db_dependent/Illrequests.t | 4 ++-- > t/db_dependent/Koha/ILL/Comments.t | 2 +- > .../ILL/Request/Attributes.t} | 12 ++++++------ > 8 files changed, 31 insertions(+), 23 deletions(-) > rename Koha/{Illrequestattribute.pm => ILL/Request/Attribute.pm} (88%) > rename Koha/{Illrequestattributes.pm => ILL/Request/Attributes.pm} (82%) > rename t/db_dependent/{Illrequestattributes.t => Koha/ILL/Request/Attributes.t} (85%) > >diff --git a/Koha/Illrequestattribute.pm b/Koha/ILL/Request/Attribute.pm >similarity index 88% >rename from Koha/Illrequestattribute.pm >rename to Koha/ILL/Request/Attribute.pm >index b5b75dee3dc..ce1b47fd040 100644 >--- a/Koha/Illrequestattribute.pm >+++ b/Koha/ILL/Request/Attribute.pm >@@ -1,4 +1,4 @@ >-package Koha::Illrequestattribute; >+package Koha::ILL::Request::Attribute; > > # Copyright PTFS Europe 2016 > # >@@ -25,7 +25,7 @@ use base qw(Koha::Object); > > =head1 NAME > >-Koha::Illrequestattribute - Koha Illrequestattribute Object class >+Koha::ILL::Request::Attribute - Koha Illrequestattribute Object class > > =head1 API > >@@ -70,7 +70,7 @@ sub _type { > > =head3 to_api_mapping > >-This method returns the mapping for representing a Koha::Illrequestattribute object >+This method returns the mapping for representing a Koha::ILL::Request::Attribute object > on the API. > > =cut >diff --git a/Koha/Illrequestattributes.pm b/Koha/ILL/Request/Attributes.pm >similarity index 82% >rename from Koha/Illrequestattributes.pm >rename to Koha/ILL/Request/Attributes.pm >index fbf34093661..ba2c4fd7dac 100644 >--- a/Koha/Illrequestattributes.pm >+++ b/Koha/ILL/Request/Attributes.pm >@@ -1,4 +1,4 @@ >-package Koha::Illrequestattributes; >+package Koha::ILL::Request::Attributes; > > # Copyright PTFS Europe 2016 > # >@@ -20,13 +20,13 @@ package Koha::Illrequestattributes; > use Modern::Perl; > > use Koha::Database; >-use Koha::Illrequestattribute; >+use Koha::ILL::Request::Attribute; > > use base qw(Koha::Objects); > > =head1 NAME > >-Koha::Illrequestattributes - Koha Illrequestattributes Object class >+Koha::ILL::Request::Attributes - Koha Illrequestattributes Object class > > =head1 API > >@@ -36,7 +36,7 @@ Koha::Illrequestattributes - Koha Illrequestattributes Object class > > =head3 search > >-my $attributes = Koha::Illrequestattributes->search( $params ); >+my $attributes = Koha::ILL::Request::Attributes->search( $params ); > > =cut > >@@ -61,7 +61,7 @@ sub _type { > =cut > > sub object_class { >- return 'Koha::Illrequestattribute'; >+ return 'Koha::ILL::Request::Attribute'; > } > > =head1 AUTHOR >diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm >index 68b026c65b8..9bb8e894c8a 100644 >--- a/Koha/Illrequest.pm >+++ b/Koha/Illrequest.pm >@@ -31,7 +31,7 @@ use Koha::Database; > use Koha::DateUtils qw( dt_from_string ); > use Koha::Exceptions::Ill; > use Koha::ILL::Comments; >-use Koha::Illrequestattributes; >+use Koha::ILL::Request::Attributes; > use Koha::AuthorisedValue; > use Koha::Illrequest::Logger; > use Koha::Patron; >@@ -197,7 +197,7 @@ sub statusalias { > sub illrequestattributes { > deprecated 'illrequestattributes is DEPRECATED in favor of extended_attributes'; > my ( $self ) = @_; >- return Koha::Illrequestattributes->_new_from_dbic( >+ return Koha::ILL::Request::Attributes->_new_from_dbic( > scalar $self->_result->illrequestattributes > ); > } >@@ -273,7 +273,7 @@ sub library { > > my $extended_attributes = $request->extended_attributes; > >-Returns the linked I<Koha::Illrequestattributes> resultset object. >+Returns the linked I<Koha::ILL::Request::Attributes> resultset object. > > =cut > >@@ -281,8 +281,8 @@ sub extended_attributes { > my ( $self ) = @_; > > my $rs = $self->_result->extended_attributes; >- # We call search to use the filters in Koha::Illrequestattributes->search >- return Koha::Illrequestattributes->_new_from_dbic($rs)->search; >+ # We call search to use the filters in Koha::ILL::Request::Attributes->search >+ return Koha::ILL::Request::Attributes->_new_from_dbic($rs)->search; > } > > =head3 status_alias >diff --git a/Koha/REST/V1/Illrequests.pm b/Koha/REST/V1/Illrequests.pm >index 6b8d990904a..96e6f0a18e9 100644 >--- a/Koha/REST/V1/Illrequests.pm >+++ b/Koha/REST/V1/Illrequests.pm >@@ -21,7 +21,7 @@ use Mojo::Base 'Mojolicious::Controller'; > > use C4::Context; > use Koha::Illrequests; >-use Koha::Illrequestattributes; >+use Koha::ILL::Request::Attributes; > use Koha::Libraries; > use Koha::Patrons; > use Koha::Libraries; >diff --git a/Koha/Schema/Result/Illrequestattribute.pm b/Koha/Schema/Result/Illrequestattribute.pm >index 48bd3aff5ce..a52e87ec673 100644 >--- a/Koha/Schema/Result/Illrequestattribute.pm >+++ b/Koha/Schema/Result/Illrequestattribute.pm >@@ -124,4 +124,12 @@ __PACKAGE__->add_columns( > '+readonly' => { is_boolean => 1 } > ); > >+sub koha_object_class { >+ 'Koha::ILL::Request::Attribute'; >+} >+ >+sub koha_objects_class { >+ 'Koha::ILL::Request::Attributes'; >+} >+ > 1; >diff --git a/t/db_dependent/Illrequests.t b/t/db_dependent/Illrequests.t >index a5516b28503..3d55467ac8a 100755 >--- a/t/db_dependent/Illrequests.t >+++ b/t/db_dependent/Illrequests.t >@@ -22,7 +22,7 @@ use File::Basename qw/basename/; > use C4::Circulation qw( AddIssue AddReturn ); > > use Koha::Database; >-use Koha::Illrequestattributes; >+use Koha::ILL::Request::Attributes; > use Koha::Illrequest::Config; > use Koha::Biblios; > use Koha::Patrons; >@@ -220,7 +220,7 @@ subtest 'Working with related objects' => sub { > } > ); > >- my $rs = Koha::Illrequestattributes->search( { illrequest_id => $illrq->id } ); >+ my $rs = Koha::ILL::Request::Attributes->search( { illrequest_id => $illrq->id } ); > > is( $illrq->extended_attributes->count, > $rs->count, "Fetching expected number of Illrequestattributes for our request." ); >diff --git a/t/db_dependent/Koha/ILL/Comments.t b/t/db_dependent/Koha/ILL/Comments.t >index 9cf6ebb1bd5..0994288333b 100755 >--- a/t/db_dependent/Koha/ILL/Comments.t >+++ b/t/db_dependent/Koha/ILL/Comments.t >@@ -20,7 +20,7 @@ use Modern::Perl; > use File::Basename qw/basename/; > use Koha::Database; > use Koha::Illrequests; >-use Koha::Illrequestattributes; >+use Koha::ILL::Request::Attributes; > use Koha::Illrequest::Config; > use Koha::Patrons; > use t::lib::Mocks; >diff --git a/t/db_dependent/Illrequestattributes.t b/t/db_dependent/Koha/ILL/Request/Attributes.t >similarity index 85% >rename from t/db_dependent/Illrequestattributes.t >rename to t/db_dependent/Koha/ILL/Request/Attributes.t >index 780c59a3e80..afcab4d4262 100755 >--- a/t/db_dependent/Illrequestattributes.t >+++ b/t/db_dependent/Koha/ILL/Request/Attributes.t >@@ -25,8 +25,8 @@ use t::lib::TestBuilder; > use Test::More tests => 3; > > my $schema = Koha::Database->new->schema; >-use_ok('Koha::Illrequestattribute'); >-use_ok('Koha::Illrequestattributes'); >+use_ok('Koha::ILL::Request::Attribute'); >+use_ok('Koha::ILL::Request::Attributes'); > > subtest 'Basic object tests' => sub { > >@@ -34,19 +34,19 @@ subtest 'Basic object tests' => sub { > > $schema->storage->txn_begin; > >- Koha::Illrequestattributes->search->delete; >+ Koha::ILL::Request::Attributes->search->delete; > > my $builder = t::lib::TestBuilder->new; > > my $illrqattr = $builder->build( { source => 'Illrequestattribute' } ); > >- my $illrqattr_obj = Koha::Illrequestattributes->find( >+ my $illrqattr_obj = Koha::ILL::Request::Attributes->find( > $illrqattr->{illrequest_id}, > $illrqattr->{backend}, > $illrqattr->{type} > ); > isa_ok( >- $illrqattr_obj, 'Koha::Illrequestattribute', >+ $illrqattr_obj, 'Koha::ILL::Request::Attribute', > "Correctly create and load an illrequestattribute object." > ); > is( >@@ -69,7 +69,7 @@ subtest 'Basic object tests' => sub { > $illrqattr_obj->delete; > > is( >- Koha::Illrequestattributes->search->count, 0, >+ Koha::ILL::Request::Attributes->search->count, 0, > "No attributes found after delete." > ); > >-- >2.44.0
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