Bug 33354

Summary: Error 400 Bad Request when submitting form in ERM
Product: Koha Reporter: Pedro Amorim <pedro.amorim>
Component: ERMAssignee: Pedro Amorim <pedro.amorim>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P5 - low CC: jonathan.druart, jonathan.field, lucas, martin.renvoize, pedro.amorim
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.06
Circulation function:
Bug Depends on: 32030    
Bug Blocks:    
Attachments: Bug 33354: Add 'required' UI elements
Bug 33354: Add error if related user open but user is missing
Bug 33354: Show all form error messages in the warning dialog
Bug 33354: Add 'required' UI elements
Bug 33354: Add error if related user open but user is missing
Bug 33354: Show all form error messages in the warning dialog
Bug 33354: Add 'required' UI elements
Bug 33354: Add error if related user open but user is missing
Bug 33354: Show all form error messages in the warning dialog

Description Pedro Amorim 2023-03-29 08:26:30 UTC
To reproduce:
* Add new agreement
* Fill in the preliminary mandatory fields (name and status)
* Click "add new user"
* Select a user role, do not pick a user
* Submit

You will get a 400 Bad Request error.

This is likely also happening in Licenses.

---

This would likely be fixed by making the user field mandatory
Comment 1 Pedro Amorim 2023-03-29 15:12:15 UTC
Created attachment 148931 [details] [review]
Bug 33354: Add 'required' UI elements
Comment 2 Pedro Amorim 2023-03-29 15:12:18 UTC
Created attachment 148932 [details] [review]
Bug 33354: Add error if related user open but user is missing
Comment 3 Pedro Amorim 2023-03-29 15:12:20 UTC
Created attachment 148933 [details] [review]
Bug 33354: Show all form error messages in the warning dialog
Comment 4 Jonathan Druart 2023-04-04 07:35:40 UTC
Created attachment 149113 [details] [review]
Bug 33354: Add 'required' UI elements

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Jonathan Druart 2023-04-04 07:35:42 UTC
Created attachment 149114 [details] [review]
Bug 33354: Add error if related user open but user is missing

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2023-04-04 07:35:45 UTC
Created attachment 149115 [details] [review]
Bug 33354: Show all form error messages in the warning dialog

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Martin Renvoize (ashimema) 2023-04-19 09:51:49 UTC
Created attachment 149854 [details] [review]
Bug 33354: Add 'required' UI elements

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize (ashimema) 2023-04-19 09:51:51 UTC
Created attachment 149855 [details] [review]
Bug 33354: Add error if related user open but user is missing

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize (ashimema) 2023-04-19 09:51:54 UTC
Created attachment 149856 [details] [review]
Bug 33354: Show all form error messages in the warning dialog

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize (ashimema) 2023-04-19 09:53:23 UTC
Reasonable solution, Passing QA.

I'd like to have seen a corresponding cyrpess test, but after a quick discussion with Pedro I understand there's a medium term plan to look at migrating this from new window to modal operation and then write the tests there.. writing new window tests is beyond scope here (and isn't trivial apparently)
Comment 11 Tomás Cohen Arazi (tcohen) 2023-04-19 12:22:06 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 12 Jacob O'Mara 2023-05-09 20:52:33 UTC
Nice work, thanks everyone!

Pushed to 22.11.x for the next release.
Comment 13 Lucas Gass (lukeg) 2023-05-15 14:42:12 UTC
Missing dependencies for 22.05.x, no backport.