Summary: | xt/tt_valid.t can miss an invalid construct | ||
---|---|---|---|
Product: | Koha | Reporter: | Galen Charlton <gmcharlt> |
Component: | Architecture, internals, and plumbing | Assignee: | Galen Charlton <gmcharlt> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | bgkriegel, fridolin.somers, kyle |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 12076: better detect an untranslatable template construct
[SIGNED-OFF] Bug 12076: better detect an untranslatable template construct [PASSED QA] Bug 12076: better detect an untranslatable template construct |
Description
Galen Charlton
2014-04-11 18:48:34 UTC
(In reply to Galen Charlton from comment #0) > Per bug 6458, template constructs of the form > > <li [% IF (foo) %]selected="selected"[% END %]... are forbidden, to complete the thought. (In reply to Galen Charlton from comment #0) > <li [% IF (foo) %]selected="selected"[% END %]... *sigh*. I meant <li [%- IF (foo) -%]selected="selected"[%- END -%]... Created attachment 27041 [details] [review] 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> Created attachment 27043 [details] [review] [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. Created attachment 27053 [details] [review] [PASSED QA] 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. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Works as described, passes all tests and QA script. Pushed to master. Pushed to 3.14.x, will be in 3.14.10 Picked for 3.12.15! |