From 077934019f2050d0eb50828f6b8e9a5c9bab1ec4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 10 Apr 2020 13:15:23 +0200 Subject: [PATCH] Bug 24975: Fix syntax issues --- catalogue/moredetail.pl | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt | 2 +- reports/issues_stats.pl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index 088ab2f0cc..bd6787c65c 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -135,7 +135,7 @@ my $copynumbers = my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search->unblessed } }; -$data->{'itemtypename'} = db_t('itemtype', $itemtypes->{ $data->{'itemtype'} }->{description}); +$data->{'itemtypename'} = db_t('itemtype', $itemtypes->{ $data->{'itemtype'} }->{description}) if $data->{itemtype} && exists $itemtypes->{ $data->{itemtype} }; foreach ( keys %{$data} ) { $template->param( "$_" => defined $data->{$_} ? $data->{$_} : '' ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt index 49a466682b..52d728dac9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt @@ -98,7 +98,7 @@ name: 'targets', data: 'l10n_targets', render: function (data, type, row, meta) { - const languages = [% languages.json %]; + const languages = [% languages.json | $raw %]; const translations = Object.fromEntries(data.map(translation => [translation.language, translation])); let output = ''; for (const language of languages) { diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl index 15aa08d7a2..12a286ce16 100755 --- a/reports/issues_stats.pl +++ b/reports/issues_stats.pl @@ -451,7 +451,7 @@ sub calculate { $cell{coltitle_display} = ( $column =~ /ccode/ ) ? $ccodes->{$celvalue} : ( $column =~ /location/ ) ? $locations->{$celvalue} - : ( $column =~ /itemtype/ ) ? db_t('itemtype', $itemtypes_map->{$celvalue}->{description}); + : ( $column =~ /itemtype/ ) ? db_t('itemtype', $itemtypes_map->{$celvalue}->{description}) : $celvalue; # default fallback if ( $column =~ /sort1/ ) { foreach (@$Bsort1) { -- 2.20.1