From f462267e47af758890eed66de798354a2023415a Mon Sep 17 00:00:00 2001 From: Florian Bontemps Date: Wed, 27 Oct 2021 12:50:42 +0000 Subject: [PATCH] Bug 17127: Remove notes from detail.tt to only use MARCNOTES Notes come from the biblio table, but that table is already used to fill in MARCNOTES through Biblio.pm and get_marc_notes. Get_marc_notes does check for NotesToHide and already read every note on the records, but .notes doesn't go through that same filter. I don't see the point of keeping notes as a condition when MARCNOTES does the same job but better. To test: 1) Take any record, or create one 2) Input something in the 500 field (or 300 in UNIMARC) 3) In Systempreferences -> NotesToHide, fill in the number 500 (or 300). 4) Save, then go look at the record detail in the OPAC and admin website. 5) You should still see the 500 or 300 field under the Description tab. 6) Apply patch. 7) Reload the record detail page. 8) Observe the error is gone. Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Fridolin Somers Signed-off-by: Kyle M Hall (cherry picked from commit 093e4223f2fe14ffeaed664aa04596f9c1744033) Signed-off-by: Andrew Fuerste-Henry --- .../prog/en/modules/catalogue/detail.tt | 10 ++-------- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 12 +++--------- 2 files changed, 5 insertions(+), 17 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index b35f54a724..196afe2ed5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -274,7 +274,7 @@ Holdings ([% itemloop.size() || 0 | html %]) [% END %] -[% IF ( MARCNOTES || notes ) %]
  • Descriptions ([% ( MARCNOTES.size || 1 ) | html %])
  • [% END %] +[% IF ( MARCNOTES ) %]
  • Descriptions ([% ( MARCNOTES.size || 1 ) | html %])
  • [% END %] [% IF ( subscriptionsnumber ) %]
  • Subscriptions
  • [% END %] [% IF Koha.Preference('AcquisitionDetails') %]
  • Acquisition details
  • [% END %] [% IF suggestions.count %]
  • Suggestion details
  • [% END %] @@ -655,12 +655,11 @@ Note that permanent location is a code, and location may be an authval. [% END %] -[% IF ( MARCNOTES || notes ) %] +[% IF ( MARCNOTES ) %]
    -[% IF ( MARCNOTES ) %] [% FOREACH MARCNOTE IN MARCNOTES %]

    [% IF MARCNOTE.marcnote.match('^https?://\S+$') %] @@ -669,11 +668,6 @@ Note that permanent location is a code, and location may be an authval. [% MARCNOTE.marcnote | html | html_line_break %] [% END %]

    - [% END %] -[% ELSE %] - [% IF ( notes ) %] -

    [% notes | html %]

    - [% END %] [% END %]
    diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index bae494b9f7..bb59c09abe 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -521,12 +521,10 @@ [% IF (SeparateHoldings) %]
  • Other holdings [% ' ( ' _ (otheritemloop.size || 0) _ ' )' | html %]
  • [% END %] - [% IF ( MARCNOTES || notes || ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY )) %] + [% IF ( MARCNOTES || ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY )) %] [% SET title_notes_count = 0 %] [% IF MARCNOTES %] [% SET title_notes_count = MARCNOTES.size %] - [% ELSIF notes %] - [% SET title_notes_count = 1 %] [% END %] [% IF SYNDETICS_SUMMARY %][% SET title_notes_count = title_notes_count + 1 %][% END %]
  • Title notes ( [% title_notes_count | html %] )
  • @@ -682,7 +680,7 @@ [% END # / SeparateHoldings %] - [% IF ( MARCNOTES || notes || ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY )) %] + [% IF ( MARCNOTES || ( SyndeticsEnabled && SyndeticsSummary && SYNDETICS_SUMMARY )) %]
    @@ -703,15 +701,11 @@

    [% END %]
    - [% ELSE %] - [% IF ( notes ) %] -

    [% notes | html %]

    - [% END %] [% END %]
    - [% END # / IF MARCNOTES || notes %] + [% END # / IF MARCNOTES %] [% IF ( SyndeticsEnabled ) %] [% IF ( SyndeticsTOC && SYNDETICS_TOC ) %] -- 2.39.5