Bug 26223

Summary: The OPAC ISBD view does not display item information
Product: Koha Reporter: Andreas Roussos <a.roussos>
Component: OPACAssignee: Andreas Roussos <a.roussos>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi (tcohen) <tomascohen>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, ivan.dziuba, jonathan.druart, kyle, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.04,20.11.10
Circulation function:
Bug Depends on: 22696    
Bug Blocks: 28906    
Attachments: Bug 26223: include item information in OPAC ISBD view
Bug 26223: include item information in OPAC ISBD view
Bug 26223: include item information in OPAC ISBD view
Bug 26223: include item information in OPAC ISBD view
Bug 26223: include item information in OPAC ISBD view
Bug 26223: (QA follow-up) Fix filter order
Bug 26223: (QA follow-up) Fix filter order

Description Andreas Roussos 2020-08-17 08:52:14 UTC
The ISBD view in the OPAC interface does not display item information.

To reproduce this issue, have a biblio with at least one item attached to it
and include one of the following snippets in the OPACISBD system preference,
depending on your MARC flavour:

MARC21:
#952|<br/><h2>Items</h2><table><th>Copy number</th><th>Shelving location</th><th>Koha item type</th><th>Barcode</th><th>Call number (Full call number)</th><th>Materials specified (bound volume or other part)</th>|<tr><td>{952t} </td><td> {952c} </td><td> {952y} </td><td> {952p} </td><td> {952o} </td><td> {9523}</td></tr>|</table>

UNIMARC:
#995|<br/><h2>Items</h2><table><th>Copy number</th><th>Shelving location</th><th>Koha collection</th><th>Barcode</th><th>Call number (Full call number)</th><th>Numbering (volume or other part)</th>|<tr><td>{9956} </td><td> {995e} </td><td> {995h} </td><td> {995f} </td><td> {995k} </td><td> {995l}</td></tr>|</table>
Comment 1 Andreas Roussos 2020-08-17 09:06:11 UTC
Created attachment 108381 [details] [review]
Bug 26223: include item information in OPAC ISBD view

The ISBD view in the OPAC interface does not display item information.

This patch fixes that.

Test plan:
0) Have a biblio with at least one item attached to it and include one
   of the following snippets in the OPACISBD system preference,
   depending on your MARC flavour:

   MARC21:
   #952|<br/><h2>Items</h2><table><th>Copy number</th><th>Shelving
   location</th><th>Koha item type</th><th>Barcode</th><th>Call number
   (Full call number)</th><th>Materials specified (bound volume or
   other part)</th>|<tr><td>{952t} </td><td> {952c} </td><td> {952y}
   </td><td> {952p} </td><td> {952o} </td><td> {9523}</td></tr>|</table>

   UNIMARC:
   #995|<br/><h2>Items</h2><table><th>Copy number</th><th>Shelving
   location</th><th>Koha collection</th><th>Barcode</th><th>Call number
   (Full call number)</th><th>Numbering (volume or other part)</th>|
   <tr><td>{9956} </td><td> {995e} </td><td> {995h} </td><td> {995f}
   </td><td> {995k} </td><td> {995l}</td></tr>|</table>

   Switch to the OPAC ISBD view for your biblio; notice how it does
   not display item information.
1) Apply the patch, and restart Plack/memcached if necessary.
2) Refresh the OPAC ISBD view page, this time you should see item
   information as per the OPACISBD system preference setting.
Comment 2 Ivan Dziuba 2020-08-18 17:55:40 UTC Comment hidden (obsolete)
Comment 3 Ivan Dziuba 2020-08-18 17:56:02 UTC Comment hidden (obsolete)
Comment 4 Ivan Dziuba 2020-08-18 20:22:29 UTC
This patch doesn't work ...
Comment 5 Katrin Fischer 2020-08-18 20:23:17 UTC
Does the information just not show?
Comment 6 Ivan Dziuba 2020-08-19 13:41:06 UTC
(In reply to Katrin Fischer from comment #5)
> Does the information just not show?

yes
Comment 7 Andreas Roussos 2020-09-14 05:58:49 UTC
(In reply to Ivan Dziuba from comment #4)
> This patch doesn't work ...
(In reply to Ivan Dziuba from comment #6)
> (In reply to Katrin Fischer from comment #5)
> > Does the information just not show?
> 
> yes
Hi Ivan! I just tried to apply the patch on top of the current master
(51fd1db) and it worked fine. I'm not sure why it didn't work for you,
can you elaborate on what steps you followed, please?

I'm setting the status to 'Needs Signoff' to get more eyes on this...
Comment 8 Owen Leonard 2020-09-15 11:19:16 UTC
Sorry this doesn't work for me either :(

I applied the patch, modified the OPACISBD system preference, "restart_all," and refreshed the page in the OPAC. No item information shows on the page.
Comment 9 Fridolin Somers 2021-08-26 00:12:26 UTC
I think this is caused by Bug 22696

We should come back to calling :
my $record = GetMarcBiblio({
    biblionumber => $biblionumber,
    embed_items  => 1,
    opac         => 1,
    borcat       => $borcat });

Like for example in opac-export.pl :
https://git.koha-community.org/Koha-community/Koha/src/branch/20.11.x/opac/opac-export.pl#L51
Comment 10 Jonathan Druart 2021-08-26 07:57:54 UTC
This patch is working for me.

1. Use KTD
2. Edit OPACISBD and add the following content at the end:

#952|<br/><h2>Items</h2><table><th>Copy number</th><th>Shelving location</th><th>Koha item type</th><th>Barcode</th><th>Call number (Full call number)</th><th>Materials specified (bound volume or other part)</th>|<tr><td>{952t} </td><td> {952c} </td><td> {952y} </td><td> {952p} </td><td> {952o} </td><td> {9523}</td></tr>|</table>

3. /cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=11

With this patch I see the table: https://snipboard.io/usn5j7.jpg
Comment 11 Jonathan Druart 2021-08-26 07:58:40 UTC
Created attachment 124099 [details] [review]
Bug 26223: include item information in OPAC ISBD view

The ISBD view in the OPAC interface does not display item information.

This patch fixes that.

Test plan:
0) Have a biblio with at least one item attached to it and include one
   of the following snippets in the OPACISBD system preference,
   depending on your MARC flavour:

   MARC21:
   #952|<br/><h2>Items</h2><table><th>Copy number</th><th>Shelving
   location</th><th>Koha item type</th><th>Barcode</th><th>Call number
   (Full call number)</th><th>Materials specified (bound volume or
   other part)</th>|<tr><td>{952t} </td><td> {952c} </td><td> {952y}
   </td><td> {952p} </td><td> {952o} </td><td> {9523}</td></tr>|</table>

   UNIMARC:
   #995|<br/><h2>Items</h2><table><th>Copy number</th><th>Shelving
   location</th><th>Koha collection</th><th>Barcode</th><th>Call number
   (Full call number)</th><th>Numbering (volume or other part)</th>|
   <tr><td>{9956} </td><td> {995e} </td><td> {995h} </td><td> {995f}
   </td><td> {995k} </td><td> {995l}</td></tr>|</table>

   Switch to the OPAC ISBD view for your biblio; notice how it does
   not display item information.
1) Apply the patch, and restart Plack/memcached if necessary.
2) Refresh the OPAC ISBD view page, this time you should see item
   information as per the OPACISBD system preference setting.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 12 Tomás Cohen Arazi (tcohen) 2021-08-26 11:41:11 UTC
It seems to me that the order in which the filters are listed should be swapped. We want the items to be embedded and THEN their subfields filtered.
Comment 13 Tomás Cohen Arazi (tcohen) 2021-08-26 11:43:14 UTC
Well, and I would do:

my @items = $biblio->items->filter_by_visible_in_opac;

it will save lots of CPU cycles in some cases.
Comment 14 Tomás Cohen Arazi (tcohen) 2021-08-26 12:12:16 UTC
Created attachment 124101 [details] [review]
Bug 26223: include item information in OPAC ISBD view

The ISBD view in the OPAC interface does not display item information.

This patch fixes that.

Test plan:
0) Have a biblio with at least one item attached to it and include one
   of the following snippets in the OPACISBD system preference,
   depending on your MARC flavour:

   MARC21:
   #952|<br/><h2>Items</h2><table><th>Copy number</th><th>Shelving
   location</th><th>Koha item type</th><th>Barcode</th><th>Call number
   (Full call number)</th><th>Materials specified (bound volume or
   other part)</th>|<tr><td>{952t} </td><td> {952c} </td><td> {952y}
   </td><td> {952p} </td><td> {952o} </td><td> {9523}</td></tr>|</table>

   UNIMARC:
   #995|<br/><h2>Items</h2><table><th>Copy number</th><th>Shelving
   location</th><th>Koha collection</th><th>Barcode</th><th>Call number
   (Full call number)</th><th>Numbering (volume or other part)</th>|
   <tr><td>{9956} </td><td> {995e} </td><td> {995h} </td><td> {995f}
   </td><td> {995k} </td><td> {995l}</td></tr>|</table>

   Switch to the OPAC ISBD view for your biblio; notice how it does
   not display item information.
1) Apply the patch, and restart Plack/memcached if necessary.
2) Refresh the OPAC ISBD view page, this time you should see item
   information as per the OPACISBD system preference setting.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 15 Tomás Cohen Arazi (tcohen) 2021-08-26 12:12:21 UTC Comment hidden (obsolete)
Comment 16 Tomás Cohen Arazi (tcohen) 2021-08-26 12:23:13 UTC
Created attachment 124103 [details] [review]
Bug 26223: (QA follow-up) Fix filter order

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 17 Jonathan Druart 2021-08-27 13:36:58 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 18 Kyle M Hall (khall) 2021-09-03 13:57:21 UTC
Pushed to 21.05.x for 21.05.04
Comment 19 Fridolin Somers 2021-09-08 20:12:19 UTC
Pushed to 20.11.x for 20.11.10
Comment 20 Victor Grousset/tuxayo 2021-09-20 11:29:44 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.