Bug 22466: Do not ask for TT methods to be filtered
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 6 Mar 2019 14:59:55 +0000 (11:59 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 12 Mar 2019 08:35:48 +0000 (08:35 +0000)
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 158b3c3a4cfc8a97cc98a3473ca70395fdb398e1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

t/lib/QA/TemplateFilters.pm

index 0fce6da..dad22df 100644 (file)
@@ -27,6 +27,10 @@ our @tt_directives = (
     qr{^\s*LAST},
 );
 
+our @tt_methods = (
+    qr{\.push\(},
+);
+
 sub fix_filters {
     return _process_tt_content( @_ )->{new_content};
 }
@@ -128,6 +132,9 @@ sub process_tt_block {
         # It's a TT directive, no filters needed
         grep { $tt_block =~ $_ } @tt_directives
 
+        # It's a TT method
+        or grep { $tt_block =~ $_ } @tt_methods
+
         # It is a comment
         or $tt_block =~ m{^\#}