Bug 2271 - tmpl_process3.pl warns on a semmingly valid construct
Summary: tmpl_process3.pl warns on a semmingly valid construct
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: Main
Hardware: All All
: P3 minor (vote)
Assignee: Galen Charlton
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-23 08:02 UTC by Galen Charlton
Modified: 2012-10-25 23:10 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 00:48:45 UTC


---- Reported by gmcharlt@gmail.com 2008-06-23 08:02:48 ----

 



---- Additional Comments From gmcharlt@gmail.com 2008-06-23 08:06:46 ----

If a template file contains the following construct (over three lines):

<tag 
    <!-- TMPL_VAR NAME='something_else' --> 
/>

tmpl_process3.pl will report the following error:

xgettext.pl: Warning: min.tmpl: line 2: Possible SGML "closed start tag" notation: <tag 
    <

However, if the construct is on one line, no error is reported.  I.e., this passes muster:

<tag <!-- TMPL_VAR NAME='something_else' --> />

The string extractor should not be sensitive to line breaks like this.  

Note that this construct can be useful as a way of entering a 'selected="selected"' attribute to an input or select tag.



---- Additional Comments From nengard@gmail.com 2009-12-23 17:59:07 ----

This bug hasn't been touched in nearly a year, please revisit and test and close if appropriate.



---- Additional Comments From oleonard@myacpl.org 2009-12-29 16:21:21 ----

The bug is still valid. I see errors with constructions like this:

     <th id="<!-- TMPL_VAR NAME="code" -->"   style="text-align: center;
       class="<!-- TMPL_VAR NAME='colnum' -->" >

..and this:

     <td 
     <!-- TMPL_UNLESS Name="display" --> style="display:none;"<!-- /TMPL_UNLESS -->
       class="<!-- TMPL_VAR NAME="colnum"-->"  >

However, since markup guidelines suggest that we avoid this kind of construction, I think the severity of the bug can be downgraded.



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 00:48 UTC  ---

This bug was previously known as _bug_ 2271 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=2271

Actual time not defined. Setting to 0.0

Comment 1 Katrin Fischer 2011-04-25 08:26:33 UTC
Does this bug still exist with Template Toolkit?
Comment 2 Katrin Fischer 2012-04-02 06:17:20 UTC
I have retested this and our unit tests catch both cases:
<p 
    [% IF ( loggedinusername ) %]class="something"[% END %]
/>Test</p>
<p [% IF ( loggedinusername ) %]class="something"[% END %]/>Test</p>

1..1
not ok 1 - TT syntax: not using TT directive within HTML tag
#   Failed test 'TT syntax: not using TT directive within HTML tag'
#   at xt/tt_valid.t line 55.
# Files list: 
# opac-tmpl/prog/en/modules/opac-main.tt: 39, 42
# Looks like you failed 1 test of 1.

The test succeeds on current master and we will catch new instances.

Even with those constructs updating and installing German templates generates no visible errrors for me:

perl translate update de-DE
perl translate instal de-DE

The translated templates are ok in this case, but I believe there were problems with other similar constructs causing translation issues.

I am marking this resolved fixed. Please reopen if I missed something.