Bugzilla – Attachment 140721 Details for
Bug 31095
Remove Koha::Patron::Debarment::GetDebarments and use $patron->restrictions in preference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31095: Remove keyed_on_code
Bug-31095-Remove-keyedoncode.patch (text/plain), 3.06 KB, created by
Nick Clemens (kidclamp)
on 2022-09-16 16:09:16 UTC
(
hide
)
Description:
Bug 31095: Remove keyed_on_code
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-09-16 16:09:16 UTC
Size:
3.06 KB
patch
obsolete
>From 79378ff46d6af3dc49b0bcf915b29eb2a6ffaed0 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 24 Aug 2022 16:20:05 +0100 >Subject: [PATCH] Bug 31095: Remove keyed_on_code > >We no longer require keyed_on_code from Koha::Patron::Restrictoin::Types >as we have relation accessors for the relevent use cases and no longer >reference the method anywhere in the codebase! > >Test plan >1. Confirm 'keyed_on_code' is no longer referenced anywhere in the > codebase. > `git grep keyed_on_code` > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/Patron/Restriction/Types.pm | 18 ------ > .../Koha/Patron/Restriction/Types.t | 63 ------------------- > 2 files changed, 81 deletions(-) > delete mode 100755 t/db_dependent/Koha/Patron/Restriction/Types.t > >diff --git a/Koha/Patron/Restriction/Types.pm b/Koha/Patron/Restriction/Types.pm >index 7f7911cdd2..2c1b37e518 100644 >--- a/Koha/Patron/Restriction/Types.pm >+++ b/Koha/Patron/Restriction/Types.pm >@@ -32,24 +32,6 @@ Koha::Patron::Restriction::Types - Koha Restriction Types Object set class > > =cut > >-=head3 keyed_on_code >- >-Return all restriction types as a hashref keyed on the code >- >-=cut >- >-sub keyed_on_code { >- my ( $self ) = @_; >- >- my @all = $self->_resultset()->search(); >- my $out = {}; >- for my $r( @all ) { >- my %col = $r->get_columns; >- $out->{$r->code} = \%col; >- } >- return $out; >-} >- > =head3 _type > > =cut >diff --git a/t/db_dependent/Koha/Patron/Restriction/Types.t b/t/db_dependent/Koha/Patron/Restriction/Types.t >deleted file mode 100755 >index fb11089656..0000000000 >--- a/t/db_dependent/Koha/Patron/Restriction/Types.t >+++ /dev/null >@@ -1,63 +0,0 @@ >-#!/usr/bin/perl >- >-use Modern::Perl; >- >-use C4::Context; >-use Koha::Database; >-use t::lib::TestBuilder; >- >-use Test::More tests => 2; >- >-my $schema = Koha::Database->new->schema; >-$schema->storage->txn_begin; >-my $dbh = C4::Context->dbh; >-my $builder = t::lib::TestBuilder->new; >- >-use_ok('Koha::Patron::Restriction::Types'); >- >-$dbh->do(q|DELETE FROM borrower_debarments|); >-$dbh->do(q|DELETE FROM restriction_types|); >- >-$builder->build( >- { >- source => 'RestrictionType', >- value => { >- code => 'ONE', >- display_text => 'One', >- is_system => 1, >- is_default => 0 >- } >- } >-); >-$builder->build( >- { >- source => 'RestrictionType', >- value => { >- code => 'TWO', >- display_text => 'Two', >- is_system => 1, >- is_default => 1 >- } >- } >-); >- >-# keyed_on_code >-my $keyed = Koha::Patron::Restriction::Types->keyed_on_code; >-my $expecting = { >- ONE => { >- code => 'ONE', >- display_text => 'One', >- is_system => 1, >- is_default => 0 >- }, >- TWO => { >- code => 'TWO', >- display_text => 'Two', >- is_system => 1, >- is_default => 1 >- } >-}; >- >-is_deeply( $keyed, $expecting, 'keyed_on_code returns correctly' ); >- >-$schema->storage->txn_rollback; >-- >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 31095
:
139614
|
139719
|
139720
|
139721
|
139722
|
139723
|
139724
|
139725
|
139726
|
139727
|
139728
|
139742
|
139743
|
139744
|
139745
|
139746
|
139747
|
139748
|
139749
|
139750
|
139751
|
139752
|
139753
|
139754
|
139755
|
139756
|
139757
|
139758
|
140714
|
140715
|
140716
|
140717
|
140718
|
140719
|
140720
|
140721
|
140722
|
140723
|
140724
|
140725
|
140726
|
140727
|
140728
|
140729
|
140730
|
140731
|
142059
|
142060
|
142061
|
142062
|
142063
|
142064
|
142065
|
142066
|
142067
|
142068
|
142069
|
142070
|
142071
|
142072
|
142073
|
142074
|
142075
|
142076
|
143745
|
143746
|
143747
|
143748
|
143749
|
143750
|
143751
|
143752
|
143753
|
143754
|
143755
|
143756
|
143757
|
143758
|
143759
|
143760
|
143761
|
143762
|
143763
|
144903
|
144904
|
144905
|
144906
|
144907
|
144908
|
144909
|
144910
|
144911
|
144912
|
144913
|
144914
|
144915
|
144916
|
144917
|
144918
|
144919
|
144920
|
144921
|
145800
|
145801
|
145803
|
145845