From 72c59d4a0cc0442fac2b25dbf47cfb18ad53db22 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 --- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 6 +++--- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 4 ++-- 2 files changed, 5 insertions(+), 5 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 8e4c8375f1e..6c952253167 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 %])
  • [% 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 %]
    @@ -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..61ca37ee6ac 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -378,7 +378,7 @@ [% 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 %] @@ -569,7 +569,7 @@ [% END # / IF MARCNOTES || notes %] - [% IF ComponentParts.size %] + [% IF ComponentParts && ComponentParts.size %]
  • -- 2.25.1