From 7502f4182e450a60017a5aacfccd8c411dc99c30 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 Signed-off-by: Marcel de Rooy Signed-off-by: Jonathan Druart --- .../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 3aedb27d95..684a082ffa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -269,7 +269,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 %] @@ -675,7 +675,7 @@ Note that permanent location is a code, and location may be an authval. [% END %] -[% IF ComponentParts.size %] +[% IF ComponentParts && ComponentParts.size %]
    @@ -688,7 +688,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 %]
    @@ -1264,7 +1264,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 caa937813d..f38ea4e0f2 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -402,13 +402,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 ) %] @@ -593,7 +593,7 @@
    [% END # / IF MARCNOTES || notes %] - [% IF ComponentParts.size %] + [% IF ComponentParts && ComponentParts.size %]
    @@ -606,7 +606,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.39.5