[Koha-bugs] [Bug 8407] New: xt/tt_valid.t is too strict

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Jul 10 15:16:19 CEST 2012


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8407

          Priority: P5 - low
 Change sponsored?: ---
            Bug ID: 8407
          Assignee: oleonard at myacpl.org
           Summary: xt/tt_valid.t is too strict
          Severity: enhancement
    Classification: Unclassified
                OS: All
          Reporter: jonathan.druart at biblibre.com
          Hardware: All
            Status: NEW
           Version: unspecified
         Component: Templates
           Product: Koha

A new bug (Bug 8385) highlights a problem already known : 
In Koha, we forbid the following syntax in tt files:
    <option value="foo" [% IF ( option.selected ) %] selected="selected" [% END
%]>bar</option>

We prefer :
    [% IF ( option.selected ) %]
        <option value="foo" selected="selected">bar</option>
    [% ELSE %]
        <option value="foo">bar</option>
    [% END %]

For Bug 8385, if I want to make tt_valid.t happy, I should replace 8 lines
(with the same structure as previous) with 40 lines.
These new lines get nowhere.
Less readability (discutable), less concise, a lot of useless lines, etc.

Why ?

I don't know exactly. The translator tool crashes if this kind of syntax
occurs.

In fact, after few test, it seems the problem existed with HTML::Template, but
I don't get through with Template::Toolkit.

It would seem that we can introduce a IF statement to add attributes like
selected, checked or disabled (for example).
Given that the string (between IF and END) does not contain translatable
strings.

I will propose a patch (for discussion and massive test).
It would be great if several testers could check that this patch does not valid
a broken template or a template containing non translatable strings.

Like as Frédéric Demians said me, it is a time bomb and we have to be sure the
templates do not passed as valid if they are not.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list