From 883bdb6c766f38556dd5181b570189982aeb8331 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 22 Oct 2021 10:15:45 +0200 Subject: [PATCH] Bug 11175: Uniformize ComponentParts in template More robust as it takes empty array into account --- .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 8 ++++---- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 8 ++++---- 2 files changed, 8 insertions(+), 8 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 f1cad362533..3d853ca4f62 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 @@ [% END %] [% IF ( MARCNOTES || notes ) %]
  • Descriptions ([% ( MARCNOTES.size || 1 ) | html %])
  • [% END %] -[% IF ( ComponentParts ) %]
  • Components ([% ( ComponentParts.size ) %])
  • [% END %] +[% IF ComponentParts && ComponentParts.size %]
  • Components ([% ComponentParts.size | html %])
  • [% END %] [% IF ( subscriptionsnumber ) %]
  • Subscriptions
  • [% END %] [% IF Koha.Preference('AcquisitionDetails') %]
  • Acquisition details
  • [% END %] [% IF suggestions.count %]
  • Suggestion details
  • [% END %] @@ -680,7 +680,7 @@ Note that permanent location is a code, and location may be an authval. [% END %] -[% IF ComponentParts.size %] +[% IF ComponentParts && ComponentParts.size %]
    @@ -693,7 +693,7 @@ Note that permanent location is a code, and location may be an authval. [% END %]
    [% IF ComponentParts.size == Koha.Preference('MaxComponentRecords')%] -

    Only [% ComponentParts.size %] results are shown: show all component parts

    +

    Only [% ComponentParts.size | html %] results are shown: show all component parts

    [% END %]
    @@ -1271,7 +1271,7 @@ Note that permanent location is a code, and location may be an authval. [% IF count == 0 %] [% IF ( Koha.Preference('HTML5MediaEnabled') == 'staff' or Koha.Preference('HTML5MediaEnabled') == 'both' ) && HTML5MediaSets.size %] $('#bibliodetails').tabs("option", "active", $('#media_tab').index() ); - [% ELSIF ComponentParts %] + [% ELSIF ComponentParts && ComponentParts.size %] $('#bibliodetails').tabs("option", "active", $('#components_tab').index() ); [% 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 4d0b28e456c..0c56f988132 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -378,13 +378,13 @@ [% IF SYNDETICS_SUMMARY %][% SET title_notes_count = title_notes_count + 1 %][% END %]
  • Title notes ( [% title_notes_count | html %] )
  • [% END %] - [% IF ( ComponentParts ) %] + [% IF ComponentParts && ComponentParts.size %] [% IF defaulttab == 'components' %]
  • [% ELSE %]
  • [% END %] - Components ([% ( ComponentParts.size ) %]) + Components ([% ComponentParts.size | html %])
  • [% END %] [% IF ( SYNDETICS_TOC ) %] @@ -569,7 +569,7 @@
    [% END # / IF MARCNOTES || notes %] - [% IF ComponentParts.size %] + [% IF ComponentParts && ComponentParts.size %]
    @@ -582,7 +582,7 @@ [% END %]
    [% IF ComponentParts.size == Koha.Preference('MaxComponentRecords')%] -

    Only [% ComponentParts.size %] results are shown: show all component parts

    +

    Only [% ComponentParts.size | html %] results are shown: show all component parts

    [% END %]
    -- 2.25.1