Bug 16047 - Software error on deleting a group with no category code
Summary: Software error on deleting a group with no category code
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Aleisha Amohia
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 16092
  Show dependency treegraph
 
Reported: 2016-03-10 21:44 UTC by Aleisha Amohia
Modified: 2016-12-05 21:25 UTC (History)
6 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Trivial patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16047: Making category code a required field on creating a group (1.67 KB, patch)
2016-03-10 21:52 UTC, Aleisha Amohia
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 16047: Making category code a required field on creating a group (1.77 KB, patch)
2016-03-17 13:16 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16047 [Follow-up] Software error on deleting a group with no category code (3.51 KB, patch)
2016-03-17 13:16 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16047 [Follow-up] Software error on deleting a group with no category code (3.67 KB, patch)
2016-03-17 13:47 UTC, Marc Véron
Details | Diff | Splinter Review
[PASSED QA] Bug 16047: Making category code a required field on creating a group (1.78 KB, patch)
2016-03-20 21:12 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 16047 [Follow-up] Software error on deleting a group with no category code (3.73 KB, patch)
2016-03-20 21:13 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.