Bug 21085

Summary: Can't edit patrons with housebound module active
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: PatronsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Josef Moravec <josef.moravec>
Severity: major    
Priority: P5 - low CC: gmcharlt, jonathan.druart, josef.moravec, kyle.m.hall, martin.renvoize, nick
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21136
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 20287    
Bug Blocks: 20828    
Attachments: Bug 21085: Fix add/edit of patrons when HouseboundModule is set
Bug 21085: Fix add/edit of patrons when HouseboundModule is set
Bug 21085: Fix add/edit of patrons when HouseboundModule is set

Description Katrin Fischer 2018-07-18 19:50:10 UTC
When the housebound module is activated, trying to save a patron record after editing it will result in an internal server errror:

No property housebound_deliverer for Koha::Patron

To test:
- Activate housebound, system preference: HouseboundModule
- Edit a patron using the edit button in the toolbar
- Save the patron
- Verify you get an Internal server error.
Comment 1 Jonathan Druart 2018-07-18 21:21:05 UTC
On creating the error is:
Patron creation failed! - DBIx::Class::Row::store_column(): No such column 'housebound_chooser' on Koha::Schema::Result::Borrower at /home/vagrant/kohaclone/Koha/Object.pm line 75
Comment 2 Jonathan Druart 2018-07-18 21:25:15 UTC
Caused by bug 20287.
Comment 3 Jonathan Druart 2018-07-18 21:28:41 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2018-07-19 05:58:16 UTC Comment hidden (obsolete)
Comment 5 Josef Moravec 2018-07-19 12:01:10 UTC
Created attachment 77102 [details] [review]
Bug 21085: Fix add/edit of patrons when HouseboundModule is set

This script takes all the parameters then set it to create/edit the
patron. We must list housebound_chooser and housebound_deliverer as not
part of patron's attributes

Test plan:
- Enable HouseboundModule
- Create a patron
=> When you save, if the patch is not applied, you will get:
No property housebound_deliverer for Koha::Patron

- Edit a patron
=> When you save, if the patch is not applied, you will get:
Patron creation failed! - DBIx::Class::Row::store_column(): No such column 'housebound_chooser' on Koha::Schema::Result::Borrower at /home/vagrant/kohaclone/Koha/Object.pm line 75

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 6 Nick Clemens (kidclamp) 2018-07-19 17:39:26 UTC
Awesome work all!

Pushed to master for 18.11
Comment 7 Martin Renvoize (ashimema) 2018-08-02 13:35:45 UTC
Depends on (and is caused by) but 20287 which is not in 18.05.x series.