Bugzilla – Attachment 61965 Details for
Bug 18208
Add RecordProcessor filter to inject not onloan count to MARC records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18208: [QA Follow-up] Get count from Koha::Items
Bug-18208-QA-Follow-up-Get-count-from-KohaItems.patch (text/plain), 1.41 KB, created by
Marcel de Rooy
on 2017-04-07 09:58:52 UTC
(
hide
)
Description:
Bug 18208: [QA Follow-up] Get count from Koha::Items
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-04-07 09:58:52 UTC
Size:
1.41 KB
patch
obsolete
>From 3df8ed47b447c662422153acb3304cfeb1440c18 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 7 Apr 2017 11:56:52 +0200 >Subject: [PATCH] Bug 18208: [QA Follow-up] Get count from Koha::Items >Content-Type: text/plain; charset=utf-8 > >Removes the loop by moving the onloan test to the query. > >Test plan: >Run the test again. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/Filter/MARC/EmbedItemsAvailability.pm | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > >diff --git a/Koha/Filter/MARC/EmbedItemsAvailability.pm b/Koha/Filter/MARC/EmbedItemsAvailability.pm >index db8b04a..2f23036 100644 >--- a/Koha/Filter/MARC/EmbedItemsAvailability.pm >+++ b/Koha/Filter/MARC/EmbedItemsAvailability.pm >@@ -74,13 +74,10 @@ sub _processrecord { > my ($biblionumber_field, $biblionumber_subfield) = GetMarcFromKohaField("biblio.biblionumber", ''); > my $biblionumber = $record->field($biblionumber_field)->subfield($biblionumber_subfield); > >- my $not_onloan_items = 0; >- my $items = Koha::Items->search({ biblionumber => $biblionumber }); >- >- while ( my $item = $items->next ) { >- $not_onloan_items++ >- if not $item->onloan; >- } >+ my $not_onloan_items = Koha::Items->search({ >+ biblionumber => $biblionumber, >+ onloan => undef, >+ })->count; > > # check for field 999 > my $destination_field = $record->field('999'); >-- >2.1.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 18208
:
60812
|
60815
|
61964
| 61965