Bug 13948: Prevent explosion when Template::Plugin::Stash not installed

TEST PLAN
---------
1) Install first two patches
2) do not install, or uninstall Template::Plugin::Stash
3) Upgrade to make sure system preference is added.
4) Set the system preference to turn it on for Staff and OPAC
5) Refresh staff -- kaboom
6) Load OPAC -- kaboom
7) Apply this patch
8) Reload staff and OPAC
   -- nice HTML comment about what is wrong.
9) run koha qa test tools.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Neat, runs well. Tested with/without sysprefs and Template::Plugin::Stash
No koha-qa errors

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
This commit is contained in:
Mark Tompsett 2015-05-15 00:49:18 -04:00 committed by Tomas Cohen Arazi
parent daab662c7c
commit c0a52bb198
2 changed files with 28 additions and 14 deletions

View File

@ -3,15 +3,22 @@
[% USE Koha %]
[% IF Koha.Preference('DumpTemplateVarsIntranet') %]
[% USE Stash %]
[% USE Dumper %]
<!--
[% FILTER replace('<!--', '<!- -') %]
[% FILTER replace('-->', '- ->') %]
[% Dumper.dump( Stash.stash() ) %]
[% TRY %]
[% USE Stash %]
[% USE Dumper %]
<!--
[% FILTER replace('<!--', '<!- -') %]
[% FILTER replace('-->', '- ->') %]
[% Dumper.dump( Stash.stash() ) %]
[% END %]
[% END %]
-->
[% CATCH %]
<!--
DumpTemplateVarsIntranet is set to 'Do', but
Template::Plugin::Stash is not installed.
-->
[% END %]
-->
[% END %]
[% IF ( bidi ) %]<html lang="[% lang %]" dir="[% bidi %]">[% ELSE %]<html lang="[% lang %]">[% END %]

View File

@ -3,15 +3,22 @@
[% USE Koha %]
[% IF Koha.Preference('DumpTemplateVarsOpac') %]
[% USE Stash %]
[% USE Dumper %]
<!--
[% FILTER replace('<!--', '<!- -') %]
[% FILTER replace('-->', '- ->') %]
[% Dumper.dump( Stash.stash() ) %]
[% TRY %]
[% USE Stash %]
[% USE Dumper %]
<!--
[% FILTER replace('<!--', '<!- -') %]
[% FILTER replace('-->', '- ->') %]
[% Dumper.dump( Stash.stash() ) %]
[% END %]
[% END %]
-->
[% CATCH %]
<!--
DumpTemplateVarsOpac is set to 'Do', but
Template::Plugin::Stash is not installed.
-->
[% END %]
-->
[% END %]
[% IF ( bidi ) %]<html lang="[% lang %]" dir="[% bidi %]" class="no-js">[% ELSE %]<html lang="[% lang %]" class="no-js">[% END %]