Bugzilla – Attachment 45755 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 CheckCategoryUnique
Bug-15295-KohaLibraries---Remove-CheckCategoryUniq.patch (text/plain), 2.41 KB, created by
Marc Véron
on 2015-12-17 10:55:38 UTC
(
hide
)
Description:
Bug 15295: Koha::Libraries - Remove CheckCategoryUnique
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2015-12-17 10:55:38 UTC
Size:
2.41 KB
patch
obsolete
>From 64de66e0f4cdacbac65a8f36460dee600b11746c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 3 Dec 2015 14:06:13 +0000 >Subject: [PATCH] Bug 15295: Koha::Libraries - Remove CheckCategoryUnique >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This subroutine is not used anymore and was not really useful. >The branchcategories table has a primary key defined on categorycode. > >Signed-off-by: Marc Véron <veron@veron.ch> >--- > C4/Branch.pm | 22 ---------------------- > t/db_dependent/Branch.t | 7 +------ > 2 files changed, 1 insertion(+), 28 deletions(-) > >diff --git a/C4/Branch.pm b/C4/Branch.pm >index 4d344fb..c9c5505 100644 >--- a/C4/Branch.pm >+++ b/C4/Branch.pm >@@ -42,7 +42,6 @@ BEGIN { > &GetBranchCategories > &GetBranchesInCategory > &ModBranchCategoryInfo >- &CheckCategoryUnique > &mybranch > &GetBranchesCount > ); >@@ -492,27 +491,6 @@ sub ModBranchCategoryInfo { > } > } > >-=head2 CheckCategoryUnique >- >-if (CheckCategoryUnique($categorycode)){ >- # do something >-} >- >-=cut >- >-sub CheckCategoryUnique { >- my $categorycode = shift; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare("SELECT categorycode FROM branchcategories WHERE categorycode = ?"); >- $sth->execute(uc( $categorycode) ); >- if (my $data = $sth->fetchrow_hashref){ >- return 0; >- } >- else { >- return 1; >- } >-} >- > =head2 CheckBranchCategorycode > > $number_rows_affected = CheckBranchCategorycode($categorycode); >diff --git a/t/db_dependent/Branch.t b/t/db_dependent/Branch.t >index a7b889f..bf95a03 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 => 36; >+use Test::More tests => 34; > > use C4::Branch; > use Koha::Libraries; >@@ -48,7 +48,6 @@ can_ok( > GetBranchCategories > GetBranchesInCategory > ModBranchCategoryInfo >- CheckCategoryUnique > mybranch > GetBranchesCount) > ); >@@ -334,10 +333,6 @@ is( > 'BRC has been added to CAT1' > ); > >-#Test CheckCategoryUnique >-is( CheckCategoryUnique('CAT2'), 0, 'CAT2 exists' ); >-is( CheckCategoryUnique('CAT_NO_EXISTS'), 1, 'CAT_NO_EXISTS doesnt exist' ); >- > #Test GetCategoryTypes > my @category_types = GetCategoryTypes(); > is_deeply(\@category_types, [ 'searchdomain', 'properties' ], 'received expected library category types'); >-- >1.7.10.4
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