Bug 17127 - Can't hide MARC21 500 and others with NotesToHide
Summary: Can't hide MARC21 500 and others with NotesToHide
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
: 28067 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-08-15 11:02 UTC by Katrin Fischer
Modified: 2021-04-02 15:20 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2016-08-15 11:02:49 UTC
NotesBlacklist will hide fields from the descriptions tab in the OPAC. This works fine for all fields, but 500 in our tests.
Comment 1 Liz Rea 2016-11-30 00:45:17 UTC
I confirm this, moreover it seems like it's 5xx fields, not just 500.
Comment 2 Magnus Enger 2019-02-25 10:33:43 UTC
I have a record with two 5xx fields: 500 and 518. 

If I set NotesBlacklist = 500 I get this:
<div id="marcnotes"><p>Text of 518</p></div>
OK

If I set NotesBlacklist = 518 I get this:
<div id="marcnotes"><p>Text of 500</p></div>
OK

If I set NotesBlacklist = 500,518 I get this:
<p>Text of 500</p>
Not so OK...
Comment 3 Magnus Enger 2019-02-25 11:28:03 UTC
The template code that outputs the notes in koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt looks like this:

 704 [% IF ( MARCNOTES || notes || ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY )) %]
 705     <div id="descriptions">
 706         <div class="content_set">
 707 
 708         [% IF ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY ) %]
 709             <h4>Enhanced descriptions from Syndetics:</h4>
 710             <p>[% SYNDETICS_SUMMARY | html %]</p>
 711         [% END %]
 712 
 713         [% IF ( MARCNOTES ) %]
 714             <div id="marcnotes">
 715             [% FOREACH MARCNOTE IN MARCNOTES %]
 716                 <p>
 717                 [% IF MARCNOTE.marcnote.match('^https?://\S+$') %]
 718                     <a href="[% MARCNOTE.marcnote | url %]">[% MARCNOTE.marcnote | html %]</a>
 719                 [% ELSE %]
 720                     [% MARCNOTE.marcnote | html | html_line_break %]
 721                 [% END %]
 722                 </p>
 723             [% END %]
 724             </div>
 725         [% ELSE %]
 726             [% IF ( notes ) %]
 727                 <p>[% notes | html %]</p>
 728             [% END %]
 729         [% END %]
 730 
 731         </div>
 732     </div> <!-- / #descriptions -->
 733 [% END # / IF MARCNOTES || notes %]

If I have notes in e.g. 500 and 518, and NotesBlacklist holds a single field, the remaining field is output by the line "[% MARCNOTE.marcnote | html | html_line_break %]", as it should be. 

If NotesBlacklist is given a list of fields, like "500,518", nothing is output by "[% MARCNOTE.marcnote | html | html_line_break %]", BUT the text of the 500 field is output by this line: "<p>[% notes | html %]</p>". I have not been able to figure out where the "notes" variable comes from!
Comment 4 Katrin Fischer 2019-04-09 21:57:09 UTC
Magnus, interesting riddle...
I haven't been able to find out where it comes from either. I was thinking it could be biblioitems.notes.
Comment 5 Katrin Fischer 2021-04-02 15:18:09 UTC
*** Bug 28067 has been marked as a duplicate of this bug. ***