Bug 30918 - Non-public note is visible in OPAC in Title Notes tab
Summary: Non-public note is visible in OPAC in Title Notes tab
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Martin Renvoize (ashimema)
QA Contact: Testopia
URL:
Keywords: rel_21_05_candidate, rel_21_11_candidate
Depends on:
Blocks: 29652 30744
  Show dependency treegraph
 
Reported: 2022-06-07 12:39 UTC by Martin Renvoize (ashimema)
Modified: 2023-12-28 20:42 UTC (History)
9 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the display of nonpublic notes (583$x) in the OPAC. Before this, if the OPAC visibility setting in the framework for 583$x was set not to show, it was still showing.
Version(s) released in:
22.11.00, 22.05.04, 21.11.11
Circulation function:


Attachments
Bug 30918: Allow passing filtered record to get_marc_notes (2.03 KB, patch)
2022-06-07 12:47 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 30918: Allow passing filtered record to get_marc_notes (2.08 KB, patch)
2022-06-07 13:53 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 30918: Allow passing filtered record to get_marc_notes (2.13 KB, patch)
2022-06-30 14:02 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2022-06-07 12:39:07 UTC
+++ This bug was initially created as a clone of Bug #30744 +++

To reproduce:

1. Go to Koha Administration -> Koha bibliographic frameworks
2. View the MARC structure for your BKS framework (or something else)
3. Search for tag 583, edit subfields
4. Go to subfield 'x' - nonpublic note. Confirm the OPAC visibility checkbox is UNCHECKED.
5. Edit or create a record using the BKS framework. Put a note in the 583$x.
6. View this record in the OPAC
7. Go to the Title notes tab. Confirm the non-public note is showing, even though the framework says it should not be visible via the OPAC.
Comment 1 Martin Renvoize (ashimema) 2022-06-07 12:47:45 UTC
Created attachment 135761 [details] [review]
Bug 30918: Allow passing filtered record to get_marc_notes

This patch does the absolute bare minimum to prevent private notes from
appearing on the OPAC.

Test plan
1. Go to Koha Administration -> Koha bibliographic frameworks
2. View the MARC structure for your BKS framework (or something else)
3. Search for tag 583, edit subfields
4. Go to subfield 'x' - nonpublic note. Confirm the OPAC visibility
   checkbox is UNCHECKED.
5. Edit or create a record using the BKS framework. Put a note in the
   583$x.
6. View this record in the OPAC
7. Go to the Title notes tab. Confirm the non-public note is
   showing, even though the framework says it should not be
   visible via the OPAC.
8. Apply patch
9. Confirm the non-public note is no longer visible
Comment 2 Owen Leonard 2022-06-07 13:53:15 UTC
Created attachment 135772 [details] [review]
Bug 30918: Allow passing filtered record to get_marc_notes

This patch does the absolute bare minimum to prevent private notes from
appearing on the OPAC.

Test plan
1. Go to Koha Administration -> Koha bibliographic frameworks
2. View the MARC structure for your BKS framework (or something else)
3. Search for tag 583, edit subfields
4. Go to subfield 'x' - nonpublic note. Confirm the OPAC visibility
   checkbox is UNCHECKED.
5. Edit or create a record using the BKS framework. Put a note in the
   583$x.
6. View this record in the OPAC
7. Go to the Title notes tab. Confirm the non-public note is
   showing, even though the framework says it should not be
   visible via the OPAC.
8. Apply patch
9. Confirm the non-public note is no longer visible

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Jonathan Druart 2022-06-09 11:55:17 UTC
I was going to write that we should do that in get_marc_notes but just noticed you did it on bug 30744. Why this patch then?
Comment 4 Martin Renvoize (ashimema) 2022-06-09 15:13:27 UTC
I created this bug after bug 30744 after it was requested there that I do something super simple for backport.  So this is the simple first step and then I try to do a more thorough cleanup job of the code in the other bug (and follow-up bugs atop it)
Comment 5 Martin Renvoize (ashimema) 2022-06-10 07:26:55 UTC
Also, as dcook mentioned.. it was a little sub-optimal that we're fetching the metadata record twice to filter twice.. by allowing it to be passed along we may gain a minor performance improvement (unmeasured).
Comment 6 Tomás Cohen Arazi (tcohen) 2022-06-30 14:02:40 UTC
Created attachment 136778 [details] [review]
Bug 30918: Allow passing filtered record to get_marc_notes

This patch does the absolute bare minimum to prevent private notes from
appearing on the OPAC.

Test plan
1. Go to Koha Administration -> Koha bibliographic frameworks
2. View the MARC structure for your BKS framework (or something else)
3. Search for tag 583, edit subfields
4. Go to subfield 'x' - nonpublic note. Confirm the OPAC visibility
   checkbox is UNCHECKED.
5. Edit or create a record using the BKS framework. Put a note in the
   583$x.
6. View this record in the OPAC
7. Go to the Title notes tab. Confirm the non-public note is
   showing, even though the framework says it should not be
   visible via the OPAC.
8. Apply patch
9. Confirm the non-public note is no longer visible

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 7 Tomás Cohen Arazi (tcohen) 2022-07-01 12:20:26 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 8 Lucas Gass (lukeg) 2022-07-29 17:20:30 UTC
Backported to 22.05.x for 22.05.04
Comment 9 Victor Grousset/tuxayo 2022-08-15 20:07:23 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.

Nothing to document, marking resolved.
Comment 10 Victor Grousset/tuxayo 2022-08-15 20:50:14 UTC
Will backport because it's a dependency of bug 30744
Comment 11 Victor Grousset/tuxayo 2022-08-17 01:55:01 UTC
Can't backport to 21.05.x: can't solve a conflict (I can but the page crashes sooo...).
If there is an interest in having this backported (to have bug 30744), please submit a patch for 21.05.
Comment 12 Victor Grousset/tuxayo 2022-09-19 19:54:14 UTC
By the way, it has been backported to 21.11.x for v21.11.11
Comment 13 Victor Grousset/tuxayo 2022-10-21 22:37:43 UTC
Last month to get an opportunity to have this backported to 21.05.x if that is still needed and if someone can make a patch for 21.05.x