The OPAC suggestion form requires JavaScript to perform validation of mandatory fields. The configuration of required fields is incorrectly escaped with the html filter and thus breaks, breaking validation. The $raw filter should be used instead.
Created attachment 86823 [details] [review] 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.
Created attachment 86926 [details] [review] Bug 22550: OPAC suggestion form doesn't require mandatory fields Test plan: 1. OPAC->login->your purchase suggestions->New purchase suggestion 2. Click button "Submit your suggestion" directly without filling in any field. Empty suggestion record was added succeffully. 3. Apply the patch. 4. Click button "Submit your suggestion" directly without filling in any field. The required fields should be labeled in red. (you can change the mandatory fields by preference 'OPACSuggestionMandatoryFields') Signed-off-by: Bin Wen <bin.wen@inlibro.com>
Created attachment 86942 [details] [review] Bug 22550: OPAC suggestion form doesn't require mandatory fields Test plan: 1. OPAC->login->your purchase suggestions->New purchase suggestion 2. Click button "Submit your suggestion" directly without filling in any field. Empty suggestion record was added succeffully. 3. Apply the patch. 4. Click button "Submit your suggestion" directly without filling in any field. The required fields should be labeled in red. (you can change the mandatory fields by preference 'OPACSuggestionMandatoryFields') Signed-off-by: Bin Wen <bin.wen@inlibro.com> Signed-off-by: Jogiraju,T. <rajujogi.t@gmail.com>
Created attachment 86943 [details] [review] Bug 22550: OPAC suggestion form doesn't require mandatory fields Test plan: 1. OPAC->login->your purchase suggestions->New purchase suggestion 2. Click button "Submit your suggestion" directly without filling in any field. Empty suggestion record was added succeffully. 3. Apply the patch. 4. Click button "Submit your suggestion" directly without filling in any field. The required fields should be labeled in red. (you can change the mandatory fields by preference 'OPACSuggestionMandatoryFields') Signed-off-by: Bin Wen <bin.wen@inlibro.com> Signed-off-by: Jogiraju,T. <rajujogi.t@gmail.com> Signed-off-by: Jogiraju,T. <rajujogi.t@gmail.com>
Created attachment 86959 [details] [review] Bug 22550: OPAC suggestion form doesn't require mandatory fields Test plan: 1. OPAC->login->your purchase suggestions->New purchase suggestion 2. Click button "Submit your suggestion" directly without filling in any field. Empty suggestion record was added succeffully. 3. Apply the patch. 4. Click button "Submit your suggestion" directly without filling in any field. The required fields should be labeled in red. (you can change the mandatory fields by preference 'OPACSuggestionMandatoryFields') Signed-off-by: Bin Wen <bin.wen@inlibro.com> Signed-off-by: Jogiraju,T. <rajujogi.t@gmail.com> Signed-off-by: Jogiraju,T. <rajujogi.t@gmail.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.05
this isn't necessary in 18.05, not backporting
The usage of raw could be avoided here, I have opened bug 22800 to remove it.