Bug 10011 - Branch limitiations are not saved on creating a new patron category
Summary: Branch limitiations are not saved on creating a new patron category
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-09 15:50 UTC by Katrin Fischer
Modified: 2015-12-03 22:11 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 10011: Save branch limitations on creating a new patron category (2.47 KB, patch)
2015-04-10 12:00 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 10011: Save branch limitations on creating a new patron category (2.76 KB, patch)
2015-04-11 05:27 UTC, Mark Tompsett
Details | Diff | Splinter Review
[PASSED QA] Bug 10011: Save branch limitations on creating a new patron category (2.83 KB, patch)
2015-04-17 06:07 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 Katrin Fischer 2013-04-09 15:50:03 UTC
When creating a new patron category the branch limitations are not saved. When you edit a created patron category the limitations are saved correctly.

To test:
1) Create a new patron category
2) Pick one or more libraries to limit to
3) Save and verify that the table of patron categories doesn't show your
   selected limitations.
Comment 1 Owen Leonard 2014-04-23 19:22:55 UTC
This bug is still valid. The code for adding a branch limitations in admin/categorie.pl was only added for the update process, not the insert process. It wouldn't be difficult to add similar code for the insert process, but since that would mean adding *more* SQL to categorie.pl I'm not sure that would be accepted.
Comment 2 Katrin Fischer 2014-04-23 19:40:54 UTC
Hm I think fixing a bug should be ok, but I haven't taken a closer look. It would be nice to have a module for categories, but I think that would be a rewrite out of the scope of this bug.
Comment 3 Jonathan Druart 2015-04-10 12:00:24 UTC Comment hidden (obsolete)
Comment 4 Mark Tompsett 2015-04-11 05:27:34 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2015-04-17 06:07:12 UTC
Created attachment 37994 [details] [review]
[PASSED QA] Bug 10011: Save branch limitations on creating a new patron category

The code was just badly placed.
It should be executed on update but also on insert.

Test plan:
1/ Create a new patron category and select 1+ branch limitations
2/ Confirm it's correctly saved
3/ Edit it and change the branch limitations
4/ Confirm it's correctly saved

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

NOTE: Not a C4 or Koha library, so tests not required. Though,
      this code could be cleaned up and have the DB stuff put
      into some sort of library with tests to prevent regression.
      However, that dream is beyond the scope of this bug.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Tomás Cohen Arazi 2015-05-19 12:29:38 UTC
Patch pushed to master.

Thanks Jonathan!