[Koha-bugs] [Bug 23625] ArticleRequestsMandatoryFields* only affects field labels, does not make inputs required

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Sep 16 22:16:00 CEST 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23625

--- Comment #3 from Eric Phetteplace <ephetteplace at cca.edu> ---
I created a patch sticking closely to what the template already looked like.
But I do wonder if incredibly repetitive templating like this isn't better as a
loop:

[% FOREACH field IN ['title', 'author', 'volume', 'issue', 'date', 'pages' ,
'chapters'] %]
    <li>
        [% IF mandatory_fields.search(field) %]
            <label for="[% field %]" class="required">[% field FILTER ucfirst
%]:</label>
            <input type="text" required name="[% field %]" id="[% field %]"
size="50"/>
        [% ELSE %]
            <label for="[% field %]">[% field FILTER ucfirst %]:</label>
            <input type="text" name="[% field %]" id="[% field %]" size="50"/>
        [% END %]
    </li>
[% END %]

Is there a reason that pattern isn't used here? Does it not play well with
internationalization? I don't know template toolkit that well so forgive me if
it doesn't work, I'm just speculating based on reading some documentation.

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


More information about the Koha-bugs mailing list