Bug 22550

Summary: OPAC suggestion form doesn't require mandatory fields
Product: Koha Reporter: Owen Leonard <oleonard>
Component: OPACAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: jonathan.druart, lucas, martin.renvoize, nick, rajujogi.t
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 13618    
Bug Blocks: 22800    
Attachments: Bug 22550: OPAC suggestion form doesn't require mandatory fields
Bug 22550: OPAC suggestion form doesn't require mandatory fields
Bug 22550: OPAC suggestion form doesn't require mandatory fields
Bug 22550: OPAC suggestion form doesn't require mandatory fields
Bug 22550: OPAC suggestion form doesn't require mandatory fields

Description Owen Leonard 2019-03-20 16:16:08 UTC
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.
Comment 1 Owen Leonard 2019-03-20 16:35:14 UTC Comment hidden (obsolete)
Comment 2 Bin Wen 2019-03-22 19:05:19 UTC Comment hidden (obsolete)
Comment 3 ByWater Sandboxes 2019-03-23 09:32:20 UTC Comment hidden (obsolete)
Comment 4 ByWater Sandboxes 2019-03-23 09:39:05 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2019-03-24 15:20:21 UTC
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>
Comment 6 Nick Clemens (kidclamp) 2019-03-28 13:29:38 UTC
Awesome work all!

Pushed to master for 19.05
Comment 7 Martin Renvoize (ashimema) 2019-04-01 10:44:46 UTC
Pushed to 18.11.x for 18.11.05
Comment 8 Lucas Gass (lukeg) 2019-04-01 16:17:15 UTC
this isn't necessary in 18.05, not backporting
Comment 9 Jonathan Druart 2019-04-29 02:12:08 UTC
The usage of raw could be avoided here, I have opened bug 22800 to remove it.