Bugzilla – Attachment 108346 Details for
Bug 20469
Add item status to staff article requests form
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20469: Remove effective parameter
Bug-20469-Remove-effective-parameter.patch (text/plain), 2.42 KB, created by
Katrin Fischer
on 2020-08-16 09:11:55 UTC
(
hide
)
Description:
Bug 20469: Remove effective parameter
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-08-16 09:11:55 UTC
Size:
2.42 KB
patch
obsolete
>From 926e17f6036578877178c55b3fd8bbce6fcb2859 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 27 Jul 2020 13:34:21 +0000 >Subject: [PATCH] Bug 20469: Remove effective parameter > >Test plan: >Run test Koha/Item.t again > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > Koha/Item.pm | 8 ++++---- > t/db_dependent/Koha/Item.t | 8 +++----- > 2 files changed, 7 insertions(+), 9 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 2d66448ba3..8602b9a308 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -822,15 +822,15 @@ sub to_api_mapping { > > =head3 itemtype > >- my $itemtype = $item->itemtype({ effective => 1 }); >+ my $itemtype = $item->itemtype; > >- Returns Koha object for (effective) itemtype >+ Returns Koha object for effective itemtype > > =cut > > sub itemtype { >- my ( $self, $params ) = @_; >- return Koha::ItemTypes->find( $params->{effective} ? $self->effective_itemtype : $self->itype ); # no FK >+ my ( $self ) = @_; >+ return Koha::ItemTypes->find( $self->effective_itemtype ); > } > > =head2 Internal methods >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index e8852ff589..44cd0b8e2b 100644 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -504,7 +504,7 @@ subtest 'renewal_branchcode' => sub { > }; > > subtest 'Tests for itemtype' => sub { >- plan tests => 4; >+ plan tests => 2; > $schema->storage->txn_begin; > > my $biblio = $builder->build_sample_biblio; >@@ -512,11 +512,9 @@ subtest 'Tests for itemtype' => sub { > my $item = $builder->build_sample_item({ biblionumber => $biblio->biblionumber, itype => $itemtype->itemtype }); > > t::lib::Mocks::mock_preference('item-level_itypes', 1); >- is( $item->itemtype({ effective => 1 })->itemtype, $item->itype, 'Pref enabled, effective parameter' ); >- is( $item->itemtype->itemtype, $item->itype, 'Pref enabled, no parameter' ); >+ is( $item->itemtype->itemtype, $item->itype, 'Pref enabled' ); > t::lib::Mocks::mock_preference('item-level_itypes', 0); >- is( $item->itemtype({ effective => 1 })->itemtype, $biblio->biblioitem->itemtype, 'Pref disabled, effective parameter' ); >- is( $item->itemtype->itemtype, $item->itype, 'Pref disabled, no parameter' ); >+ is( $item->itemtype->itemtype, $biblio->biblioitem->itemtype, 'Pref disabled' ); > > $schema->storage->txn_rollback; > }; >-- >2.11.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 20469
:
73281
|
73282
|
73388
|
76627
|
76628
|
76630
|
76631
|
77184
|
77185
|
77186
|
77222
|
77223
|
77224
|
107235
|
107236
|
107412
|
107413
|
107417
|
107418
|
107419
|
108345
| 108346 |
108347