Bugzilla – Attachment 162883 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: Illcomment.pm -> ILL/Comment.pm
Bug-35581-Illcommentpm---ILLCommentpm.patch (text/plain), 6.90 KB, created by
Pedro Amorim
on 2024-03-07 10:36:31 UTC
(
hide
)
Description:
Bug 35581: Illcomment.pm -> ILL/Comment.pm
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-03-07 10:36:31 UTC
Size:
6.90 KB
patch
obsolete
>From ace5c4e01a498ef42cf6b021d2e8c7f912e1f4ee Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Thu, 14 Dec 2023 14:41:07 -0100 >Subject: [PATCH] Bug 35581: Illcomment.pm -> ILL/Comment.pm > >Illcomments.pm -> ILL/Comments.pm > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/{Illcomment.pm => ILL/Comment.pm} | 8 ++++---- > Koha/{Illcomments.pm => ILL/Comments.pm} | 12 ++++++------ > Koha/Illrequest.pm | 8 ++++---- > ill/ill-requests.pl | 4 ++-- > .../{Illcomments.t => Koha/ILL/Comments.t} | 8 ++++---- > t/db_dependent/api/v1/ill_requests.t | 2 +- > 6 files changed, 21 insertions(+), 21 deletions(-) > rename Koha/{Illcomment.pm => ILL/Comment.pm} (87%) > rename Koha/{Illcomments.pm => ILL/Comments.pm} (81%) > rename t/db_dependent/{Illcomments.t => Koha/ILL/Comments.t} (93%) > >diff --git a/Koha/Illcomment.pm b/Koha/ILL/Comment.pm >similarity index 87% >rename from Koha/Illcomment.pm >rename to Koha/ILL/Comment.pm >index 594af5379ce..7bd1f13f870 100644 >--- a/Koha/Illcomment.pm >+++ b/Koha/ILL/Comment.pm >@@ -1,4 +1,4 @@ >-package Koha::Illcomment; >+package Koha::ILL::Comment; > > # Copyright Magnus Enger Libriotech 2017 > # >@@ -23,13 +23,13 @@ use base qw(Koha::Object); > > =head1 NAME > >-Koha::Illcomment - Koha Illcomment Object class >+Koha::ILL::Comment - Koha Illcomment Object class > > =head2 Class methods > > =head3 patron > >- my $patron = Koha::Illcomment->patron; >+ my $patron = Koha::ILL::Comment->patron; > > Return the patron object associated with this comment > >@@ -46,7 +46,7 @@ sub patron { > > =head3 _type > >- my $type = Koha::IllComment->_type; >+ my $type = Koha::ILL::Comment->_type; > > Return this object's type > >diff --git a/Koha/Illcomments.pm b/Koha/ILL/Comments.pm >similarity index 81% >rename from Koha/Illcomments.pm >rename to Koha/ILL/Comments.pm >index 01d15884e78..3f9c29c89e1 100644 >--- a/Koha/Illcomments.pm >+++ b/Koha/ILL/Comments.pm >@@ -1,4 +1,4 @@ >-package Koha::Illcomments; >+package Koha::ILL::Comments; > > # Copyright Magnus Enger Libriotech 2017 > # >@@ -19,18 +19,18 @@ package Koha::Illcomments; > > use Modern::Perl; > use Koha::Database; >-use Koha::Illcomment; >+use Koha::ILL::Comment; > use base qw(Koha::Objects); > > =head1 NAME > >-Koha::Illcomments - Koha Illcomments Object class >+Koha::ILL::Comments - Koha Illcomments Object class > > =head2 Internal methods > > =head3 _type > >- my $type = Koha::IllComments->_type; >+ my $type = Koha::ILL::Comments->_type; > > Return this object's type > >@@ -42,14 +42,14 @@ sub _type { > > =head3 object_class > >- my $class = Koha::IllComments->object_class; >+ my $class = Koha::ILL::Comments->object_class; > > Return this object's class name > > =cut > > sub object_class { >- return 'Koha::Illcomment'; >+ return 'Koha::ILL::Comment'; > } > > =head1 AUTHOR >diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm >index 9c0a414db0e..546cb20081c 100644 >--- a/Koha/Illrequest.pm >+++ b/Koha/Illrequest.pm >@@ -30,7 +30,7 @@ use Koha::Cache::Memory::Lite; > use Koha::Database; > use Koha::DateUtils qw( dt_from_string ); > use Koha::Exceptions::Ill; >-use Koha::Illcomments; >+use Koha::ILL::Comments; > use Koha::Illrequestattributes; > use Koha::AuthorisedValue; > use Koha::Illrequest::Logger; >@@ -208,7 +208,7 @@ sub illrequestattributes { > > sub illcomments { > my ( $self ) = @_; >- return Koha::Illcomments->_new_from_dbic( >+ return Koha::ILL::Comments->_new_from_dbic( > scalar $self->_result->illcomments > ); > } >@@ -217,13 +217,13 @@ sub illcomments { > > my $ill_comments = $req->comments; > >-Returns a I<Koha::Illcomments> resultset for the linked comments. >+Returns a I<Koha::ILL::Comments> resultset for the linked comments. > > =cut > > sub comments { > my ( $self ) = @_; >- return Koha::Illcomments->_new_from_dbic( >+ return Koha::ILL::Comments->_new_from_dbic( > scalar $self->_result->comments > ); > } >diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl >index 04b1d131ea1..cc72c737ab6 100755 >--- a/ill/ill-requests.pl >+++ b/ill/ill-requests.pl >@@ -25,7 +25,7 @@ use C4::Auth qw( get_template_and_user ); > use C4::Output qw( output_and_exit output_html_with_http_headers ); > use Koha::Notice::Templates; > use Koha::AuthorisedValues; >-use Koha::Illcomment; >+use Koha::ILL::Comment; > use Koha::Illrequests; > use Koha::Illrequest; > use Koha::ILL::Batches; >@@ -411,7 +411,7 @@ if ( $backends_available ) { > > $template->param( table_actions => encode_json( Koha::Illrequest->get_staff_table_actions ) ); > } elsif ( $op eq "save_comment" ) { >- my $comment = Koha::Illcomment->new({ >+ my $comment = Koha::ILL::Comment->new({ > illrequest_id => scalar $params->{illrequest_id}, > borrowernumber => $patronnumber, > comment => scalar $params->{comment}, >diff --git a/t/db_dependent/Illcomments.t b/t/db_dependent/Koha/ILL/Comments.t >similarity index 93% >rename from t/db_dependent/Illcomments.t >rename to t/db_dependent/Koha/ILL/Comments.t >index 85cc63021c5..742f16af9d6 100755 >--- a/t/db_dependent/Illcomments.t >+++ b/t/db_dependent/Koha/ILL/Comments.t >@@ -32,8 +32,8 @@ use Test::More tests => 9; > > my $schema = Koha::Database->new->schema; > my $builder = t::lib::TestBuilder->new; >-use_ok('Koha::Illcomment'); >-use_ok('Koha::Illcomments'); >+use_ok('Koha::ILL::Comment'); >+use_ok('Koha::ILL::Comments'); > > $schema->storage->txn_begin; > >@@ -66,13 +66,13 @@ my $illcomment = $builder->build({ > > # Get all the comments > my $comments = $illrq_obj->illcomments; >-isa_ok( $comments, 'Koha::Illcomments', "Illcomments" ); >+isa_ok( $comments, 'Koha::ILL::Comments', "Illcomments" ); > my @comments_list = $comments->as_list(); > is( scalar @comments_list, 1, "We have 1 comment" ); > > # Get the first (and only) comment > my $comment = $comments->next(); >-isa_ok( $comment, 'Koha::Illcomment', "Illcomment" ); >+isa_ok( $comment, 'Koha::ILL::Comment', "Illcomment" ); > > # Check the different data in the comment > is( $comment->illrequest_id, $illrq_obj->illrequest_id, 'illrequest_id getter works' ); >diff --git a/t/db_dependent/api/v1/ill_requests.t b/t/db_dependent/api/v1/ill_requests.t >index 3e7bb9d681f..7822acc4863 100755 >--- a/t/db_dependent/api/v1/ill_requests.t >+++ b/t/db_dependent/api/v1/ill_requests.t >@@ -209,7 +209,7 @@ subtest 'list() tests' => sub { > # x-koha-embed: comments > # Create comment > my $comment_text = "This is the comment"; >- my $comment = $builder->build_object({ class => 'Koha::Illcomments', value => { illrequest_id => $req_1->illrequest_id, comment => $comment_text , borrowernumber => $patron->borrowernumber } } ); >+ my $comment = $builder->build_object({ class => 'Koha::ILL::Comments', value => { illrequest_id => $req_1->illrequest_id, comment => $comment_text , borrowernumber => $patron->borrowernumber } } ); > > # Make sure comments come back > $t->get_ok("//$userid:$password@/api/v1/ill/requests" => {"x-koha-embed" => "comments"} ) >-- >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