Bug 11508 - Untranslatable pull-down in auth_subfields_structure.pl
Summary: Untranslatable pull-down in auth_subfields_structure.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Bernardo Gonzalez Kriegel
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-09 12:23 UTC by paxed
Modified: 2015-06-04 23:30 UTC (History)
5 users (show)

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


Attachments
Bug 11508 - Untranslatable pull-down in auth_subfields_structure.pl (6.25 KB, patch)
2014-04-05 00:12 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 11508 - Untranslatable pull-down in auth_subfields_structure.pl (7.00 KB, patch)
2014-04-11 21:13 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
[SIGNED OFF] Bug 11508 - Untranslatable pull-down in auth_subfields_structure.pl (7.20 KB, patch)
2014-04-15 19:21 UTC, Mark Tompsett
Details | Diff | Splinter Review
0001-PASSED-QA-Bug-11508-Untranslatable-pull-down-in-auth.patch (7.36 KB, patch)
2014-04-19 10:37 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2014-01-09 12:23:27 UTC
The pull-down for "Select to display or not:" contains strings "Show All" and "Hide All", these are hard-coded in admin/auth_subfields_structure.pl
Comment 1 Bernardo Gonzalez Kriegel 2014-04-05 00:12:14 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2014-04-11 18:42:04 UTC
The change to the template includes improperly nested [% IF %]s inside HTML tags:

<option value= "0" [%- IF ( loo.ohidden.default ==  0 ) -%]selected="selected"[%- END -%]>Show all</option>

This should be written:

[%- IF ( loo.ohidden.default ==  0 ) -%]
    <option value= "0" selected="selected">Show all</option>
[%- ELSE -%
    <option value= "0">Show all</option>
[%- END -%]

This is because of problems the translation script has with parsing template directives nested inside tags:

http://wiki.koha-community.org/wiki/Coding_Guidelines#HTML1:_Template_Toolkit_markup_inside_HTML

This should have been caught by the QA tool, but it looks like the "-" in "[%- IF" isn't an expected pattern. It would be nice if the QA test tool were updated to be aware of that construction.
Comment 3 Katrin Fischer 2014-04-11 18:43:30 UTC
What is the reason for the -?
Comment 4 Galen Charlton 2014-04-11 18:59:31 UTC
(In reply to Katrin Fischer from comment #3)
> What is the reason for the -?

It's a valid TT construct to make sure it doesn't emit extra whitespace before the value to be put in, and is fine to use -- just not within a tag.

See bug 12076 for a change to the test case to catch the problem.
Comment 5 Bernardo Gonzalez Kriegel 2014-04-11 21:13:12 UTC Comment hidden (obsolete)
Comment 6 Bernardo Gonzalez Kriegel 2014-04-11 21:15:38 UTC
(In reply to Owen Leonard from comment #2)
> 
> This should be written:
> 
> [%- IF ( loo.ohidden.default ==  0 ) -%]
>     <option value= "0" selected="selected">Show all</option>
> [%- ELSE -%
>     <option value= "0">Show all</option>
> [%- END -%]

Sorry for that, and thanks for testing and the reference :)
Now is fixed.
Comment 7 Mark Tompsett 2014-04-15 19:21:24 UTC Comment hidden (obsolete)
Comment 8 Mark Tompsett 2014-04-15 19:25:17 UTC
Comment on attachment 27144 [details] [review]
[SIGNED OFF] Bug 11508 - Untranslatable pull-down in auth_subfields_structure.pl

Review of attachment 27144 [details] [review]:
-----------------------------------------------------------------

::: koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt
@@ +94,5 @@
> +                        <option value="-1" selected="selected">ignore</option>
> +                        [%- ELSE -%]
> +                        <option value="-1">ignore</option>
> +                        [%- END -%]
> +                    [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] -%]

There's a tab '10'? Well, it was in the old dropdown too, so no problem. It is just strange.
Comment 9 Bernardo Gonzalez Kriegel 2014-04-15 19:34:47 UTC
(In reply to M. Tompsett from comment #8)
> > +                    [%- FOREACH t IN [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] -%]
> 
> There's a tab '10'? Well, it was in the old dropdown too, so no problem. It
> is just strange.

Perhaps by copy of biblio's one, where tab 10 is for items...
Comment 10 Katrin Fischer 2014-04-19 10:37:08 UTC
Created attachment 27307 [details] [review]
0001-PASSED-QA-Bug-11508-Untranslatable-pull-down-in-auth.patch
Comment 11 Galen Charlton 2014-04-19 14:44:13 UTC
Pushed to master.  Thanks, Bernardo!
Comment 12 Fridolin Somers 2014-08-06 12:30:08 UTC
Pushed to 3.14.x, will be in 3.14.10