Bugzilla – Attachment 45370 Details for
Bug 15295
Move the C4::Branch related code to Koha::Libraries - part 2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15295: Koha::Libraries - Remove CheckBranchCategorycode
Bug-15295-KohaLibraries---Remove-CheckBranchCatego.patch (text/plain), 3.48 KB, created by
Jonathan Druart
on 2015-12-03 16:15:49 UTC
(
hide
)
Description:
Bug 15295: Koha::Libraries - Remove CheckBranchCategorycode
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-12-03 16:15:49 UTC
Size:
3.48 KB
patch
obsolete
>From 560ce542072cf08aba66c3a815dd589e5f75bc6e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 3 Dec 2015 14:09:36 +0000 >Subject: [PATCH] Bug 15295: Koha::Libraries - Remove CheckBranchCategorycode > >This verification is now done in admin/branches.pl, no need for a >special subroutine/method, it's 1 line only called once. >--- > C4/Branch.pm | 21 --------------------- > t/db_dependent/Branch.t | 23 +---------------------- > 2 files changed, 1 insertion(+), 43 deletions(-) > >diff --git a/C4/Branch.pm b/C4/Branch.pm >index c9c5505..14fcd20 100644 >--- a/C4/Branch.pm >+++ b/C4/Branch.pm >@@ -36,7 +36,6 @@ BEGIN { > &GetBranchDetail > &get_branchinfos_of > &ModBranch >- &CheckBranchCategorycode > &GetBranchInfo > &GetCategoryTypes > &GetBranchCategories >@@ -490,26 +489,6 @@ sub ModBranchCategoryInfo { > $sth->execute($data->{'categoryname'}, $data->{'codedescription'},$data->{'categorytype'},$data->{'show_in_pulldown'},uc( $data->{'categorycode'} ) ); > } > } >- >-=head2 CheckBranchCategorycode >- >-$number_rows_affected = CheckBranchCategorycode($categorycode); >- >-=cut >- >-sub CheckBranchCategorycode { >- >- # check to see if the branchcode is being used in the database somewhere.... >- my ($categorycode) = @_; >- my $dbh = C4::Context->dbh; >- my $sth = >- $dbh->prepare( >- "select count(*) from branchrelations where categorycode=?"); >- $sth->execute($categorycode); >- my ($total) = $sth->fetchrow_array; >- return $total; >-} >- > sub GetBranchesCount { > my $dbh = C4::Context->dbh(); > my $query = "SELECT COUNT(*) AS branches_count FROM branches"; >diff --git a/t/db_dependent/Branch.t b/t/db_dependent/Branch.t >index bf95a03..c98ea1a 100644 >--- a/t/db_dependent/Branch.t >+++ b/t/db_dependent/Branch.t >@@ -21,7 +21,7 @@ use Modern::Perl; > use C4::Context; > use Data::Dumper; > >-use Test::More tests => 34; >+use Test::More tests => 30; > > use C4::Branch; > use Koha::Libraries; >@@ -42,7 +42,6 @@ can_ok( > GetBranchDetail > get_branchinfos_of > ModBranch >- CheckBranchCategorycode > GetBranchInfo > GetCategoryTypes > GetBranchCategories >@@ -229,19 +228,9 @@ is( $cat2detail, undef, 'CAT2 doesnt exist' ); > $category = GetBranchCategory(); > is($category, undef, 'retrieve library category only if code is supplied (bug 10515)'); > >-#Test CheckBranchCategoryCode >-my $check1 = CheckBranchCategorycode( $cat1->{categorycode} ); >-my $check2 = CheckBranchCategorycode( $cat2->{categorycode} ); >-like( $check1, '/^\d+$/', "CheckBranchCategorycode returns a number" ); >- > $b2->{CAT1} = 1; > ModBranch($b2); > is( GetBranchesCount(), $count + 2, 'BRB added' ); >-is( >- CheckBranchCategorycode( $cat1->{categorycode} ), >- $check1 + 1, >- 'BRB added to CAT1' >-); > > #Test GetBranchInfo > my $b1info = GetBranchInfo( $b1->{branchcode} ); >@@ -284,11 +273,6 @@ $b2 = { > }; > ModBranch($b2); > $b2info = GetBranchInfo( $b2->{branchcode} ); >-is( >- CheckBranchCategorycode( $cat2->{categorycode} ), >- $check2 + 1, >- 'BRB added to CAT2' >-); > push( @cat, $cat2->{categorycode} ); > delete $b2->{CAT1}; > delete $b2->{CAT2}; >@@ -327,11 +311,6 @@ ModBranch($b3); > $brCat1 = GetBranchesInCategory( $cat1->{categorycode} ); > push( @b, $b3->{branchcode} ); > is_deeply( $brCat1, \@b, 'CAT1 has branch BRB and BRC' ); >-is( >- CheckBranchCategorycode( $cat1->{categorycode} ), >- $check1 + 2, >- 'BRC has been added to CAT1' >-); > > #Test GetCategoryTypes > my @category_types = GetCategoryTypes(); >-- >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 15295
:
45368
|
45369
|
45370
|
45371
|
45372
|
45373
|
45374
|
45375
|
45752
|
45754
|
45755
|
45756
|
45757
|
45760
|
45763
|
45764
|
45765
|
45924
|
45925
|
45926
|
45927
|
45928
|
45929
|
45930
|
45931
|
46684
|
46696