Bugzilla – Attachment 31240 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: Follow-up removing biblioitem routines
Bug-11518-Follow-up-removing-biblioitem-routines.patch (text/plain), 2.67 KB, created by
Marcel de Rooy
on 2014-08-28 10:16:17 UTC
(
hide
)
Description:
Bug 11518: Follow-up removing biblioitem routines
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2014-08-28 10:16:17 UTC
Size:
2.67 KB
patch
obsolete
>From 580efea086e46e799b36ce0cf3f79837ebdc6c8c Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 28 Aug 2014 11:58:10 +0200 >Subject: [PATCH] Bug 11518: Follow-up removing biblioitem routines >Content-Type: text/plain; charset=utf-8 > >There is no need to define biblioitem routines, if we can access them >via biblioitemnumber. >Note that we actually need a FK for biblio in the items table. Now we do >need the intermediate level via biblioitems in the Items.t code. Even better, >we should move biblioitem to biblio. Formally it is 1-n, but in reality it >is 1-1. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/Schema/Result/Biblio.pm | 6 ------ > Koha/Schema/Result/Item.pm | 8 +------- > t/db_dependent/Items.t | 3 ++- > 3 files changed, 3 insertions(+), 14 deletions(-) > >diff --git a/Koha/Schema/Result/Biblio.pm b/Koha/Schema/Result/Biblio.pm >index b61086e..9fd413b 100644 >--- a/Koha/Schema/Result/Biblio.pm >+++ b/Koha/Schema/Result/Biblio.pm >@@ -331,10 +331,4 @@ __PACKAGE__->many_to_many("sets", "oai_sets_biblios", "set"); > # Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21 > # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0//8OGf7OteNnwT03g4QsA > >-sub biblioitem { >- my ( $self ) = @_; >- my @biblioitems = $self->biblioitems; >- return $biblioitems[0]; >-} >- > 1; >diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm >index 98ba0cc..57c0856 100644 >--- a/Koha/Schema/Result/Item.pm >+++ b/Koha/Schema/Result/Item.pm >@@ -612,12 +612,6 @@ __PACKAGE__->might_have( > # Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-07-11 09:26:55 > # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Rc89LTrsDtt8Y6yXVUdhMA > >-sub biblioitem { >- my ( $self ) = @_; >- my @biblioitems = $self->biblioitemnumber; >- return $biblioitems[0]; >-} >- > sub effective_itemtype { > my ( $self ) = @_; > >@@ -625,7 +619,7 @@ sub effective_itemtype { > if ( $pref->value() ) { > return $self->itype(); > } else { >- return $self->biblioitem()->itemtype(); >+ return $self->biblioitemnumber()->itemtype(); > } > } > >diff --git a/t/db_dependent/Items.t b/t/db_dependent/Items.t >index cfdbdcf..a484af0 100755 >--- a/t/db_dependent/Items.t >+++ b/t/db_dependent/Items.t >@@ -204,7 +204,8 @@ subtest q{Test Koha::Database->schema()->resultset('Item')->itemtype()} => sub { > } > ); > >- my ( $item ) = $biblio->biblioitem->items(); >+ my @bi = $biblio->biblioitems(); >+ my ( $item ) = $bi[0]->items(); > > C4::Context->set_preference( 'item-level_itypes', 0 ); > ok( $item->effective_itemtype() eq 'BIB_LEVEL', '$item->itemtype() returns biblioitem.itemtype when item-level_itypes is disabled' ); >-- >1.7.7.6
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