From 58482aa97872d36b20db13327fa70daef889a393 Mon Sep 17 00:00:00 2001 From: Gabriel DeCarufel Date: Wed, 8 Jan 2020 16:23:14 -0500 Subject: [PATCH] Bug 17385: QA Critics Fixed and added Missing Filters --- C4/XSLT.pm | 13 ++++++++++--- .../intranet-tmpl/prog/en/includes/cat-toolbar.inc | 2 +- .../prog/en/includes/virtualshelves-toolbar.inc | 2 +- .../intranet-tmpl/prog/en/modules/basket/basket.tt | 2 +- .../prog/en/modules/catalogue/detail.tt | 2 +- .../prog/en/modules/virtualshelves/downloadshelf.tt | 2 +- .../bootstrap/en/includes/opac-detail-sidebar.inc | 2 +- .../bootstrap/en/modules/opac-downloadcart.tt | 2 +- .../bootstrap/en/modules/opac-downloadshelf.tt | 2 +- t/db_dependent/XSLT.t | 4 ++-- 10 files changed, 20 insertions(+), 13 deletions(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 798c66e6ee..7643bec969 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -164,6 +164,12 @@ sub _get_best_default_xslt_filename { return $xslfilename; } +=head2 get_xslt_sysprefs + + returns XML xslt sysprefs. + +=cut + sub get_xslt_sysprefs { my $sysxml = "\n"; foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow @@ -263,7 +269,7 @@ sub XSLTParse4Display { my $itemsxml = buildKohaItemsNamespace($biblionumber, $hidden_items); my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour')); - $variables ||= {}; + my $variables ||= {}; if (C4::Context->preference('OPACShowOpenURL')) { my @biblio_itemtypes; my $biblio = Koha::Biblios->find($biblionumber); @@ -416,7 +422,7 @@ sub CustomXSLTExportList { '/' . C4::Context->preference( $opac ? "opacthemes" : "template") . '/' . C4::Languages::getlanguage() . '/xslt/biblioexport'; - my @files = <$dir/*.xsl>; + my @files = glob qq("$dir/*.xsl"); foreach my $file (@files) { if ( -f "$file" ) { (my $text = $file) =~ s/.*\///g; @@ -433,7 +439,8 @@ sub CustomXSLTExportList { # Get output format # There should only be one xsl:output node, so taking the first one only is OK $node = @{$node->findnodes("xsl:output")}[0]; - my $outputformat = $node->{"method"} if $node; + my $outputformat= ""; + $outputformat = $node->{"method"} if $node; $outputformat = "txt" if ($outputformat eq "" || $outputformat eq "text"); my %row = ( diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc index 39bd7c95e5..ce0a0da854 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -97,7 +97,7 @@ CAN_user_serials_create_subscription ) %]
  • MODS (XML)
  • RIS
  • [% FOREACH filesOption IN filesOptions %] -
  • [% filesOption.filename %]
  • +
  • [% filesOption.filename | html %]
  • [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc index 6c5bd3db77..c241f343f3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc @@ -32,7 +32,7 @@
  • CSV - [% csv_profile.profile | html %]
  • [% END %] [% FOREACH xsl_export IN xsl_exports %] -
  • XSL - [% xsl_export.filename %]
  • +
  • XSL - [% xsl_export.filename | html %]
  • [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt index 9c388ba1bc..ce428c396e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt @@ -57,7 +57,7 @@
  • CSV - [% csv_profile.profile | html %]
  • [% END %] [% FOREACH xsl_export IN xsl_exports %] -
  • XSL - [% xsl_export.filename %]
  • +
  • XSL - [% xsl_export.filename | html %]
  • [% END %] 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 7c2387f818..6ead8bf3e8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -753,7 +753,7 @@ [% FOREACH filesOption IN filesOptions %] - + [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/downloadshelf.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/downloadshelf.tt index 740fe5d1f0..772ac50ab8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/downloadshelf.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/downloadshelf.tt @@ -37,7 +37,7 @@ [% END %] [% FOREACH xsl_export IN xsl_exports %] - + [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc index 4e1ae642c1..7d07e07ed8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc @@ -80,7 +80,7 @@ [% ELSE %] [% FOREACH filesOption IN filesOptions %] -
  • [% filesOption.filename %]
  • +
  • [% filesOption.filename | html %]
  • [% END %] [% END %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadcart.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadcart.tt index 70c3beb1a3..2bd1215ebc 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadcart.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadcart.tt @@ -21,7 +21,7 @@ [% END %] [% FOREACH xsl_export IN xsl_exports %] - + [% END %]
    diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt index 4881ea7aa9..411168ea29 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt @@ -60,7 +60,7 @@ [% END %] [% FOREACH xsl_export IN xsl_exports %] - + [% END %] Required diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t index 968f7db8ad..74899b1391 100644 --- a/t/db_dependent/XSLT.t +++ b/t/db_dependent/XSLT.t @@ -1,5 +1,5 @@ use Modern::Perl; -use Test::More tests => 2; +use Test::More tests => 1; use t::lib::Mocks; use C4::XSLT; @@ -35,4 +35,4 @@ subtest 'CustomXSLTExportList: Caching' => sub { is( @$list, $n, 'This list comes from the cache and that is fine' ); $cache->clear_from_cache('CustomXSLTExportListOPAC'); }; -$schema->storage->txn_rollback; +$schema->storage->txn_rollback; \ No newline at end of file -- 2.17.1