[Bug 12076] New: xt/tt_valid.t can miss an invalid construct
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12076 Bug ID: 12076 Summary: xt/tt_valid.t can miss an invalid construct Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: gmcharlt@gmail.com QA Contact: testopia@bugs.koha-community.org Per bug 6458, template constructs of the form <li [% IF (foo) %]selected="selected"[% END %]... as that can cause problems with translated templates. However, the test currently doesn't catch the variation where '-' is used to suppress extra whitespace: <li [% IF (foo) %]selected="selected"[% END %]... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12076 --- Comment #1 from Galen Charlton <gmcharlt@gmail.com> --- (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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12076 --- Comment #2 from Galen Charlton <gmcharlt@gmail.com> --- (In reply to Galen Charlton from comment #0)
<li [% IF (foo) %]selected="selected"[% END %]...
*sigh*. I meant <li [%- IF (foo) -%]selected="selected"[%- END -%]... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12076 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12076 --- Comment #3 from Galen Charlton <gmcharlt@gmail.com> --- Created attachment 27041 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=27041&action=edit 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> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12076 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #27041|0 |1 is obsolete| | --- Comment #4 from Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> --- Created attachment 27043 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=27043&action=edit [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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12076 Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |bgkriegel@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12076 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12076 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #27043|0 |1 is obsolete| | --- Comment #5 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 27053 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=27053&action=edit [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. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12076 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #6 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12076 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |fridolyn.somers@biblibre.co | |m --- Comment #7 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Pushed to 3.14.x, will be in 3.14.10 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12076 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com --- Comment #8 from Kyle M Hall <kyle@bywatersolutions.com> --- Picked for 3.12.15! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org