summaryrefslogtreecommitdiffstats
path: root/template/en/default/global/hidden-fields.html.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'template/en/default/global/hidden-fields.html.tmpl')
-rw-r--r--template/en/default/global/hidden-fields.html.tmpl23
1 files changed, 11 insertions, 12 deletions
diff --git a/template/en/default/global/hidden-fields.html.tmpl b/template/en/default/global/hidden-fields.html.tmpl
index 2fa577b43..7327e43cf 100644
--- a/template/en/default/global/hidden-fields.html.tmpl
+++ b/template/en/default/global/hidden-fields.html.tmpl
@@ -20,23 +20,22 @@
#%]
[%# INTERFACE:
- # form: hash; the form fields/values for which to generate hidden fields.
- # mform: hash; the form fields/values with multiple values for which to
- # generate hidden fields.
# exclude: string; a regular expression matching fields to exclude
# from the list of hidden fields generated by this template
#%]
+[%# The global Bugzilla->cgi object is used to obtain form variable values. %]
+[% USE Bugzilla %]
+[% cgi = Bugzilla.cgi %]
+
[%# Generate hidden form fields for non-excluded fields. %]
-[% FOREACH field = form %]
- [% NEXT IF exclude && field.key.search(exclude) %]
- [% IF mform.${field.key}.size > 1 %]
- [% FOREACH mvalue = mform.${field.key} %]
- <input type="hidden" name="[% field.key FILTER html %]"
+[% FOREACH field = cgi.param() %]
+ [% NEXT IF exclude && field.search(exclude) %]
+ [%# The '.slice(0)' bit is here to force the 'param(field)' to be evaluated
+ in a list context, so we can avoid extra code checking for single valued or
+ empty fields %]
+ [% FOREACH mvalue = cgi.param(field).slice(0) %]
+ <input type="hidden" name="[% field FILTER html %]"
value="[% mvalue FILTER html FILTER html_linebreak %]">
[% END %]
- [% ELSE %]
- <input type="hidden" name="[% field.key FILTER html %]"
- value="[% field.value FILTER html FILTER html_linebreak %]">
- [% END %]
[% END %]