Bug 28422

Summary: OPAC MARC detail view doesn't correctly evaluate holdability
Product: Koha Reporter: Owen Leonard <oleonard>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: david, dcook, fridolin.somers, kyle, victor
Version: masterKeywords: Manual
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
In the normal and ISBD detail views for a record in the OPAC the 'Place hold' link only appears if a hold can actually be placed. This change fixes the MARC detail view so that it is consistent with the normal and ISBD detail views. (Before this, a 'Place hold' link would appear for the MARC detail, even if a hold couldn't be placed, for example if an item was recorded as not for loan.)
Version(s) released in:
21.11.00,21.05.02,20.11.08
Bug Depends on:    
Bug Blocks: 28605    
Attachments: Bug 28422: OPAC MARC detail view doesn't correctly evaluate holdability
Bug 28422: OPAC MARC detail view doesn't correctly evaluate holdability
Bug 28422: OPAC MARC detail view doesn't correctly evaluate holdability

Description Owen Leonard 2021-05-21 16:58:17 UTC
The MARC detail view in the OPAC will show a "Place hold" link at times when holds are not allowed. The situation which I observed was when all items were "not for loan."

The template expects the "norequests" variable to be set correctly.
Comment 1 Owen Leonard 2021-05-24 16:04:01 UTC
Created attachment 121341 [details] [review]
Bug 28422: OPAC MARC detail view doesn't correctly evaluate holdability

This patch modifies the MARC detail view in the OPAC so that it
evaluates whether a title can be placed on hold in the same way it is
done on the "normal" detail page and the ISBD detail page. This allows
for consistency in the display of the "Place hold" link.

To test, apply the patch and log into the OPAC.

 - Perform a search which will return results, at least one of which can
   be placed on hold.
 - View the detail page, the MARC detail page, and the ISBD detail page.
   In each case the "Place hold" link should appear in the sidebar.
 - View the same pages for a record which cannot be placed on hold to
   confirm that the link doesn't appear. For instance:
   - All items are not for loan.
   - All items are lost.
   - There are no items attached.
Comment 2 David Nind 2021-05-30 01:41:08 UTC
Created attachment 121508 [details] [review]
Bug 28422: OPAC MARC detail view doesn't correctly evaluate holdability

This patch modifies the MARC detail view in the OPAC so that it
evaluates whether a title can be placed on hold in the same way it is
done on the "normal" detail page and the ISBD detail page. This allows
for consistency in the display of the "Place hold" link.

To test, apply the patch and log into the OPAC.

 - Perform a search which will return results, at least one of which can
   be placed on hold.
 - View the detail page, the MARC detail page, and the ISBD detail page.
   In each case the "Place hold" link should appear in the sidebar.
 - View the same pages for a record which cannot be placed on hold to
   confirm that the link doesn't appear. For instance:
   - All items are not for loan.
   - All items are lost.
   - There are no items attached.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Katrin Fischer 2021-06-03 13:52:02 UTC
Created attachment 121594 [details] [review]
Bug 28422: OPAC MARC detail view doesn't correctly evaluate holdability

This patch modifies the MARC detail view in the OPAC so that it
evaluates whether a title can be placed on hold in the same way it is
done on the "normal" detail page and the ISBD detail page. This allows
for consistency in the display of the "Place hold" link.

To test, apply the patch and log into the OPAC.

 - Perform a search which will return results, at least one of which can
   be placed on hold.
 - View the detail page, the MARC detail page, and the ISBD detail page.
   In each case the "Place hold" link should appear in the sidebar.
 - View the same pages for a record which cannot be placed on hold to
   confirm that the link doesn't appear. For instance:
   - All items are not for loan.
   - All items are lost.
   - There are no items attached.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Katrin Fischer 2021-06-03 13:55:06 UTC
I get a strong feeling that we should centralize the code for this check... but as a bug fix this works really well.
Comment 5 David Cook 2021-06-03 23:51:32 UTC
(In reply to Katrin Fischer from comment #4)
> I get a strong feeling that we should centralize the code for this check...
> but as a bug fix this works really well.

Agreed. Holds are a total mess.
Comment 6 Jonathan Druart 2021-06-21 10:05:56 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 7 Kyle M Hall 2021-07-02 11:20:16 UTC
Pushed to 21.05.x for 21.05.02
Comment 8 Fridolin Somers 2021-07-10 02:34:37 UTC
Pushed to 20.11.x for 20.11.08
Comment 9 Fridolin Somers 2021-07-10 02:34:54 UTC
(In reply to Katrin Fischer from comment #4)
> I get a strong feeling that we should centralize the code for this check...
> but as a bug fix this works really well.

+1
Comment 10 Victor Grousset/tuxayo 2021-07-10 23:40:19 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.