Bugzilla – Attachment 42271 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: Koha::Item->effective_itemtype fallback to bib-level
Bug-14651-KohaItem-effectiveitemtype-fallback-to-b.patch (text/plain), 1.64 KB, created by
Marcel de Rooy
on 2015-09-03 07:33:24 UTC
(
hide
)
Description:
Bug 14651: Koha::Item->effective_itemtype fallback to bib-level
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-09-03 07:33:24 UTC
Size:
1.64 KB
patch
obsolete
>From 331f50f202bbdec88276646fe99e119612b203e6 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@unc.edu.ar> >Date: Tue, 18 Aug 2015 16:37:27 -0300 >Subject: [PATCH] Bug 14651: Koha::Item->effective_itemtype fallback to > bib-level >Content-Type: text/plain; charset=utf-8 > >In some situations (bad migrations, old bugs that introduced bad data, >people having bib-level itypes for ages and switching to item level...) >the user ends with undex itype values for items. > >The current code, if the user has item_level-itype set, just returns >undef. It should fallback to bib-level. In order to avoid hiding the problem >a warning is raised. > >To test: >- Run the regression tets: > $ prove t/db_dependent/Items.t >=> FAIL: tests fail. >- Apply the patch >- Run the tests again >=> SUCCESS: The tests now pass. >- Sign off :-D > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/Schema/Result/Item.pm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm >index 0650c4f..c342f46 100644 >--- a/Koha/Schema/Result/Item.pm >+++ b/Koha/Schema/Result/Item.pm >@@ -623,9 +623,11 @@ sub effective_itemtype { > my ( $self ) = @_; > > my $pref = $self->result_source->schema->resultset('Systempreference')->find('item-level_itypes'); >- if ( $pref->value() ) { >+ if ( $pref->value() && $self->itype() ) { > return $self->itype(); > } else { >+ warn "item-level_itypes set but no itemtype set for item ($self->itemnumber)" >+ if $pref->value(); > return $self->biblioitemnumber()->itemtype(); > } > } >-- >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 14651
:
41635
|
41636
|
42083
|
42084
|
42264
|
42265
|
42270
| 42271