Bugzilla – Attachment 27043 Details for
Bug 12076
xt/tt_valid.t can miss an invalid construct
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 12076: better detect an untranslatable template construct
SIGNED-OFF-Bug-12076-better-detect-an-untranslatab.patch (text/plain), 1.67 KB, created by
Bernardo Gonzalez Kriegel
on 2014-04-11 21:23:19 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 12076: better detect an untranslatable template construct
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2014-04-11 21:23:19 UTC
Size:
1.67 KB
patch
obsolete
>From e5db68e60cd11328b9d8ec9cfadcf45d3036f8e3 Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Fri, 11 Apr 2014 18:49:07 +0000 >Subject: [PATCH] [SIGNED-OFF] Bug 12076: better detect an untranslatable > template construct > >Per bug 6458, template constructs of the form > ><li [% IF (foo) %]selected="selected"[% END %]... > >are forbidden as they can cause problems with translated templates. >However, the tt_valid.t test currently doesn't catch the variation >where '-' is used to suppress extra whitespace: > ><li [%- IF (foo) -%]selected="selected"[%- END -%]... > >This patch corrects the issue. > >To test: > >[1] Temporarily add the following line to a template file: > ><li [%- IF a -%]a="a"[%- END -%] /> > >[2] Run prove -v xt/tt_valid.t. Note that no error is reported. >[3] Apply the patch, and rerun the tt_valid.t test. This time, > an error should be reported. > >Signed-off-by: Galen Charlton <gmc@esilibrary.com> >Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> > >Works well, detects the forbidden pattern >No koha-qa errors. >--- > xt/tt_valid.t | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/xt/tt_valid.t b/xt/tt_valid.t >index f71085e..e33b760 100755 >--- a/xt/tt_valid.t >+++ b/xt/tt_valid.t >@@ -38,7 +38,7 @@ my @files_with_directive_in_tag = do { > while ( my $token = $parser->next_token ) { > my $attr = $token->{_attr}; > next unless $attr; >- push @lines, $token->{_lc} if $attr->{'[%'}; >+ push @lines, $token->{_lc} if $attr->{'[%'} or $attr->{'[%-'}; > } > ($dir) = $dir =~ /koha-tmpl\/(.*)$/; > push @files, { name => "$dir/$name", lines => \@lines } if @lines; >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12076
:
27041
|
27043
|
27053