Bug 10011

Summary: Branch limitiations are not saved on creating a new patron category
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: System AdministrationAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P5 - low CC: gmcharlt, jonathan.druart, tomascohen
Version: master   
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:
Attachments: Bug 10011: Save branch limitations on creating a new patron category
Bug 10011: Save branch limitations on creating a new patron category
[PASSED QA] Bug 10011: Save branch limitations on creating a new patron category

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!