Bug 16047

Summary: Software error on deleting a group with no category code
Product: Koha Reporter: Aleisha Amohia <aleisha>
Component: System AdministrationAssignee: Aleisha Amohia <aleisha>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: brendan, f.demians, gmcharlt, julian.maurice, katrin.fischer, veron
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16091
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16015
Change sponsored?: Sponsored Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 16092    
Attachments: Bug 16047: Making category code a required field on creating a group
[SIGNED-OFF] Bug 16047: Making category code a required field on creating a group
Bug 16047 [Follow-up] Software error on deleting a group with no category code
Bug 16047 [Follow-up] Software error on deleting a group with no category code
[PASSED QA] Bug 16047: Making category code a required field on creating a group
[PASSED QA] Bug 16047 [Follow-up] Software error on deleting a group with no category code

Description Aleisha Amohia 2016-03-10 21:44:20 UTC
If you create a group (admin/branches.pl) with no category code, attempting to delete will cause this software error: Can't call method "libraries" on an undefined value at /home/vagrant/kohaclone/admin/branches.pl line 197.
Comment 1 Aleisha Amohia 2016-03-10 21:52:58 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2016-03-17 13:16:02 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2016-03-17 13:16:06 UTC Comment hidden (obsolete)
Comment 4 Marc Véron 2016-03-17 13:47:41 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2016-03-20 21:12:27 UTC
Created attachment 49348 [details] [review]
[PASSED QA] Bug 16047: Making category code a required field on creating a group

This will prevent users from creating a group without a category code,
which causes a software error when you try to delete it

To test:
1) Go to Admin -> Libraries and groups
2) Create new group without category code
3) Attempt to delete the group you just created and notice software
   error
4) Apply patch
5) Create new group without category code
6) Notice you now cannot save the group without putting in a category
  code

Sponsored-by: Catalyst IT
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2016-03-20 21:13:10 UTC
Created attachment 49349 [details] [review]
[PASSED QA] Bug 16047 [Follow-up] Software error on deleting a group with no category code

This follow-up take the original patch a little further, making category
name required on the entry form as well. Without a category name there
is no label in the interface when selecting a category. That doens't
make any sense.

Also changed on the group entry form:

- Added "required" attribute to labels on required fields.
- Changed "Update" submit button label to "Submit."
- Added a "Cancel" link.
- Added the "validated" class to the form so that our built-in
  validation script will process it (not strictly necessary but makes
  the validation appearance more consistent).

Followed test plan, form displays and behaves as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Brendan Gallagher 2016-03-22 00:56:20 UTC
Pushed to Master - Should be in the May 2016 release.  Thanks!
Comment 8 Julian Maurice 2016-04-08 06:07:22 UTC
Patches pushed to 3.22.x, will be in 3.22.6
Comment 9 Frédéric Demians 2016-04-27 15:34:08 UTC
Pushed to 3.22.x, will be in 3.20.11.