Bugzilla – Attachment 46997 Details for
Bug 15629
Move the C4::Branch related code to Koha::Libraries - part 3
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15629: Koha::Libraries - Remove GetBranchesInCategory (1)
Bug-15629-KohaLibraries---Remove-GetBranchesInCate.patch (text/plain), 2.39 KB, created by
Jonathan Druart
on 2016-01-20 14:36:35 UTC
(
hide
)
Description:
Bug 15629: Koha::Libraries - Remove GetBranchesInCategory (1)
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-01-20 14:36:35 UTC
Size:
2.39 KB
patch
obsolete
>From 92598b86e5feaf82000d35b584aa3f54ac6b138f Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 20 Jan 2016 11:21:12 +0000 >Subject: [PATCH] Bug 15629: Koha::Libraries - Remove GetBranchesInCategory (1) > >For consistency, the branchcodes method of Koha::LibraryCategory should be >named libraries. >At the moment, there is only one occurrence, in admin/branches.pl >--- > Koha/LibraryCategory.pm | 2 +- > admin/branches.pl | 2 +- > t/db_dependent/Koha/Libraries.t | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/Koha/LibraryCategory.pm b/Koha/LibraryCategory.pm >index f675d89..d6b7766 100644 >--- a/Koha/LibraryCategory.pm >+++ b/Koha/LibraryCategory.pm >@@ -41,7 +41,7 @@ sub new { > return $self->SUPER::new( $params ); > } > >-sub branchcodes{ >+sub libraries{ > my ( $self, $params ) = @_; > # TODO This should return Koha::Libraries > return $self->{_result}->branchcodes( $params ); >diff --git a/admin/branches.pl b/admin/branches.pl >index 918b10c..a655fc6 100755 >--- a/admin/branches.pl >+++ b/admin/branches.pl >@@ -194,7 +194,7 @@ if ( $op eq 'add_form' ) { > $op = 'list'; > } elsif ( $op eq 'delete_confirm_category' ) { > my $category = Koha::LibraryCategories->find($categorycode); >- if ( my $libraries_count = scalar( $category->branchcodes ) ) { >+ if ( my $libraries_count = scalar( $category->libraries ) ) { > push @messages, > { type => 'error', > code => 'cannot_delete_category', >diff --git a/t/db_dependent/Koha/Libraries.t b/t/db_dependent/Koha/Libraries.t >index 8e21567..8126b8c 100644 >--- a/t/db_dependent/Koha/Libraries.t >+++ b/t/db_dependent/Koha/Libraries.t >@@ -77,7 +77,7 @@ $retrieved_library_1->update_categories( [ $new_category_2, $new_category_3 ] ); > is( Koha::Libraries->find( $new_library_1->branchcode )->get_categories->count, 2, '2 libraries should have been linked to the category 2' ); > > my $retrieved_category_2 = Koha::LibraryCategories->find( $new_category_2->categorycode ); >-is( $retrieved_category_2->branchcodes->count, 2, '2 libraries should have been linked to the category_2' ); >+is( $retrieved_category_2->libraries->count, 2, '2 libraries should have been linked to the category_2' ); > is( $retrieved_category_2->categorycode, uc('my_cc_2'), 'The Koha::LibraryCategory constructor should have upercased the categorycode' ); > > $retrieved_library_1->delete; >-- >2.1.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 15629
:
46997
|
46998
|
46999
|
47000
|
47001
|
47002
|
47518
|
47519
|
47520
|
47521
|
47522
|
47523
|
47553
|
47701
|
47706
|
47707
|
47708
|
47709
|
47710
|
47711
|
47712
|
47713