Bugzilla – Attachment 41635 Details for
Bug 14651
Koha::Item::effective_itemtype should fallback to biblio-level if no item-level itemtype
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14651: (regression test) fallback to bib-level if itype is undef
Bug-14651-regression-test-fallback-to-bib-level-if.patch (text/plain), 1.72 KB, created by
Tomás Cohen Arazi (tcohen)
on 2015-08-18 19:41:12 UTC
(
hide
)
Description:
Bug 14651: (regression test) fallback to bib-level if itype is undef
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2015-08-18 19:41:12 UTC
Size:
1.72 KB
patch
obsolete
>From 59bf0f7042272ce445e91d62541e9797d1d06d2d Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@unc.edu.ar> >Date: Tue, 18 Aug 2015 16:34:25 -0300 >Subject: [PATCH] Bug 14651: (regression test) fallback to bib-level if itype > is undef > >Koha::Item->effective_itemtype should fallback to biblio-level itemtype >even if item-level item types are set, in the case the item has no itemtype >set (bad migration, bad old code). > >To test: >- Run > $ prove t/db_dependent/Items.t >=> FAIL: Koha::Item->effective_itemtype doesn't work properly >--- > t/db_dependent/Items.t | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index b1796bc..0b764b9 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -195,7 +195,7 @@ subtest 'GetItemsInfo tests' => sub { > > subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { > >- plan tests => 2; >+ plan tests => 3; > > # Start transaction > $dbh->{AutoCommit} = 0; >@@ -225,6 +225,14 @@ subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { > C4::Context->set_preference( 'item-level_itypes', 1 ); > ok( $item->effective_itemtype() eq 'ITEM_LEVEL', '$item->itemtype() returns items.itype when item-level_itypes is enabled' ); > >+ # If itemtype is not defined and item-level_level item types are set >+ # fallback to biblio-level itemtype (Bug 14651) >+ $item->itype( undef ); >+ $item->update(); >+ ok( defined $item->effective_itemtype() && >+ $item->effective_itemtype() eq 'BIB_LEVEL', >+ '$item->effective_itemtype() falls back to biblioitems.itemtype when item-level_itypes is enabled but undef' ); >+ > $dbh->rollback; > }; > >-- >2.5.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 14651
:
41635
|
41636
|
42083
|
42084
|
42264
|
42265
|
42270
|
42271