Bugzilla – Attachment 173609 Details for
Bug 38233
ILS-DI GetRecords should filter out items hidden in OPAC and use OPAC MARCXML
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38233: respect OPAC visibility for ILS-DI GetRecords
Bug-38233-respect-OPAC-visibility-for-ILS-DI-GetRe.patch (text/plain), 2.21 KB, created by
Pedro Amorim
on 2024-10-29 10:22:07 UTC
(
hide
)
Description:
Bug 38233: respect OPAC visibility for ILS-DI GetRecords
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2024-10-29 10:22:07 UTC
Size:
2.21 KB
patch
obsolete
>From ae2339a257a75331682b7071e09eb96a604eea30 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 22 Oct 2024 23:57:57 +0000 >Subject: [PATCH] Bug 38233: respect OPAC visibility for ILS-DI GetRecords > >This change makes the ILS-DI GetRecords service use the OPAC >version of the MARCXML and filters items based on their OPAC visibility > >Test plan: >1. Apply the patch >2. koha-plack --restart kohadev >3. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ILS-DI >and enable syspref >4. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=OpacHiddenItems >and add the following: >withdrawn: [1] >5. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=hidelostitems >Change syspref to "Don't show" >6. Go to http://localhost:8081/cgi-bin/koha/catalogue/detail.pl?biblionumber=29 >7. Add a withdrawn item and a lost item with barcodes of "test1" and "test2" respectively >8. Go to http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=GetRecords&id=29 >9. Note the items with barcodes test1 and test2 do not appear in the "items" tree and they don't >appear in the "marcxml" tree. > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com> >--- > C4/ILSDI/Services.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm >index 957bcd82fb..891d193c68 100644 >--- a/C4/ILSDI/Services.pm >+++ b/C4/ILSDI/Services.pm >@@ -218,7 +218,7 @@ sub GetRecords { > > my $biblioitem = $biblio->biblioitem->unblessed; > >- my $record = $biblio->metadata->record({ embed_items => 1 }); >+ my $record = $biblio->metadata->record({ embed_items => 1, opac => 1, }); > if ($record) { > $biblioitem->{marcxml} = $record->as_xml_record( C4::Context->preference('marcflavour') ); > } >@@ -236,7 +236,7 @@ sub GetRecords { > foreach my $checkout (@$checkouts) { > delete $checkout->{'borrowernumber'}; > } >- my @items = $biblio->items->as_list; >+ my @items = $biblio->items->filter_by_visible_in_opac->as_list; > > $biblioitem->{items}->{item} = []; > >-- >2.39.5
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 38233
:
173187
|
173236
| 173609 |
173610