Bugzilla – Attachment 25448 Details for
Bug 11518
Add new method to Koha::Schema::Result::Item that will always return the correct itemtype
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11518 [Followup] - Change method name from 'itemtype' to 'effective_itemtype' for clarity
Bug-11518-Followup---Change-method-name-from-itemt.patch (text/plain), 1.79 KB, created by
Benjamin Rokseth
on 2014-02-19 15:01:28 UTC
(
hide
)
Description:
Bug 11518 [Followup] - Change method name from 'itemtype' to 'effective_itemtype' for clarity
Filename:
MIME Type:
Creator:
Benjamin Rokseth
Created:
2014-02-19 15:01:28 UTC
Size:
1.79 KB
patch
obsolete
>From 2e8d605319e4597c00f7bbb2e18adcb9058381e3 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 10 Jan 2014 10:21:55 -0500 >Subject: [PATCH] Bug 11518 [Followup] - Change method name from 'itemtype' to > 'effective_itemtype' for clarity > >Test runs without errors. > >Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no> >--- > Koha/Schema/Result/Item.pm | 2 +- > t/db_dependent/Items.t | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm >index 656de69..6a1e0d2 100644 >--- a/Koha/Schema/Result/Item.pm >+++ b/Koha/Schema/Result/Item.pm >@@ -625,7 +625,7 @@ __PACKAGE__->belongs_to( > ); > > use C4::Context; >-sub itemtype { >+sub effective_itemtype { > my ( $self ) = @_; > > if ( C4::Context->preference('item-level_itypes') ) { >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index a4bdd1c..af7b252 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -170,10 +170,10 @@ subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { > my ( $item ) = $biblioitem->items(); > > C4::Context->set_preference( 'item-level_itypes', 0 ); >- ok( $item->itemtype() eq 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' ); >+ ok( $item->effective_itemtype() eq 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' ); > > C4::Context->set_preference( 'item-level_itypes', 1 ); >- ok( $item->itemtype() eq 'ITEM_LEVEL', '$item->itemtype() returns items.itype when item-level_itypes is disabled' ); >+ ok( $item->effective_itemtype() eq 'ITEM_LEVEL', '$item->itemtype() returns items.itype when item-level_itypes is disabled' ); > > > $dbh->rollback; >-- >1.8.3.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 11518
:
24121
|
24143
|
25448
|
25510
|
26983
|
26985
|
26987
|
27343
|
27344
|
27345
|
27346
|
27347
|
27348
|
29544
|
31240
|
31241
|
31242