https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37892 --- Comment #36 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 171824 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=171824&action=edit Bug 37892: Fix guarantor restriction, add tests [SQUASHED IN QA] These patches will alter the checks for a patron that prevent a category with 'can_be_guarantee' from being a guarantor. Two patrons in the same category should be allowed to have a guarantee/guarantor relationship The tests below assume you are using the KTD sample data. Update borrowernumbers if not. To test: 0 - Apply tests patch 1 - Set the 'Patron' category as 'Can be a guarantee' 2 - Add a relationship between two patrons of the same category This is restricted from the staff interface perl -e 'use Koha::Patrons; my $p = Koha::Patrons->find(5)->add_guarantor({ guarantor_id => 23, relationship => 'father'});' 3 - Note there is no warning or exception. This should be allowed. 4 - Checkout an item to Edna (borrowernumber 5) 5 - Set 'TrackLastPatronActivityTriggers' to 'Checking in an item' 6 - Try to check the item in, KABOOM 7 - Set 'TrackLastPatronActivityTriggers' to 'Checking out an item' 8 - Try to issue an item to Enda, KABOOM 9 - prove -v t/db_dependent/Koha/Patron.t, fail 10 - Apply second patch 11 - prove -v t/db_dependent/Koha/Patron.t, one more test passes, but then fail 12 - Apply third patch 13 - prove -v t/db_dependent/Koha/Patron.t, pass! 14 - restart_all 15 - Checkout to Enda, OK! 16 - Checkin from Edna, OK! 17 - Find two more patrons in the category and attempt to link them 18 - 'Guarantor cannot be a guarantee' 19 - Apply fourth patch 20 - You can add a guarantor from the same category in interface 21 - Try to add a guarantor to the guarantor assigned in 20 22 - Confirm you cannot add a guarantor - "Guarantor cannot be a guarantee" Signed-off-by: Olivier V <olivier.vezina@inLibro.com> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> Bug 37892: Fix patron updates Signed-off-by: Olivier V <olivier.vezina@inLibro.com> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> Bug 37892: Fix patron creation Signed-off-by: Olivier V <olivier.vezina@inLibro.com> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> Bug 37892: Fix memberentry.pl Signed-off-by: Olivier V <olivier.vezina@inLibro.com> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> Bug 37892: (follow-up) Fix patron creation This patch fixes the 22. of the test plan (22 - Confirm you cannot add a guarantor - "Guarantor cannot be a guarantee" ) Signed-off-by: Olivier V <olivier.vezina@inLibro.com> Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Bug 37892: (follow-up) Fix patron creation TEST PLAN: 1 - Do the 22 parts of the test plan 2 - Add a guarantor to one patron not selected before (let's say A is the guarantee, B the guarantor) 3 - Try and add a guarantor to B -> you will success 4 - Remove B's guarantor 5 - Apply this patch 6 - Repeat 3 -> you will not be able to Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Bug 37892: (follow-up) Tidyness Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> [EDIT] Renamed a subtest to patron creation tests in Patron.t. -- You are receiving this mail because: You are watching all bug changes.