From 1491e29e1080ac888b788087dbc423f050a2d204 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 20 Mar 2019 16:24:42 +0000 Subject: [PATCH] Bug 22550: OPAC suggestion form doesn't require mandatory fields This patch changes the template filter on the [% mandatoryfields %] template variable. The variable outputs JSON, so it should have the $raw filter. To test suggestions must be enabled in the OPAC. Apply the patch and go to Purchase suggestions -> New suggestion. In the form, required fields should be labeled in red. It should not be possible to submit the form without filling in these fields. --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt index 7cfdc8f..f560e64 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt @@ -341,7 +341,7 @@ [% END %] [% IF ( op_add && mandatoryfields ) %] { - var FldsRequired = [[% mandatoryfields | html %]]; + var FldsRequired = [[% mandatoryfields | $raw %]]; for (var i = 0; i < FldsRequired.length; i++) { var rq_input = $('#' + FldsRequired[i]); if (rq_input.length != 1) continue; -- 2.1.4