Description
Alex Buckley
2019-06-26 23:52:09 UTC
Created attachment 91038 [details] [review] Bug 23224: Fix inconsistent behaviour of memberentry.pl When editing a child patron (in memberentry.pl) and changing their patron category to a non-child patron category Koha does not set the guarantorid to 0. This means we end up with non-child patrons with guarantors, which is currently not allowed by Koha. Whereas the behaviour in child-update.pl (which can be accessed from a patrons summary page by clicking 'More'->Update child to adult patron') sets the borrowers guarantorid value to 0. This is the correct behaiviour and is what memberentry.pl should be doing. This patch fixes that. Test plan: See how memberentry.pl currently behaves 1. Create a adult patron and select 'Add child' and create the child record. 2. Enter the Koha MySQL terminal and select the guarantorid value for the child record you just created: SELECT guarantorid FROM borrowers WHERE userid=<username>; 3. Notice the guarantorid is set to the adult patrons borrowernumber 4. On the child record select 'Edit' and in the memberentry.pl page change the category to any non-child patron category (for example 'Patron') and save 5. Repeat step 2 and notice the guarantorid value has not changed ---- See how child-update.pl currently behaves 6. Repeat steps 1-3 and on the child record select More > Update child to adult patron 7. In the child-update.pl window that loads select any patron category and save 8. Repeat step 2 and notice the guarantorid is now 0 ---- See how the patch fixes the behaviour of memberentry.pl 9. Apply patch 10. Repeat steps 1-5 and notice the guarantorid is now 0 Sponsored-By: Brimbank Library, Australia Created attachment 91041 [details] [review] Bug 23224: Fix inconsistent behaviour of memberentry.pl When editing a child patron (in memberentry.pl) and changing their patron category to a non-child patron category Koha does not set the guarantorid to 0. This means we end up with non-child patrons with guarantors, which is currently not allowed by Koha. Whereas the behaviour in child-update.pl (which can be accessed from a patrons summary page by clicking 'More'->Update child to adult patron') sets the borrowers guarantorid value to 0. This is the correct behaiviour and is what memberentry.pl should be doing. This patch fixes that. Test plan: See how memberentry.pl currently behaves 1. Create a adult patron and select 'Add child' and create the child record. 2. Enter the Koha MySQL terminal and select the guarantorid value for the child record you just created: SELECT guarantorid FROM borrowers WHERE userid=<username>; 3. Notice the guarantorid is set to the adult patrons borrowernumber 4. On the child record select 'Edit' and in the memberentry.pl page change the category to any non-child patron category (for example 'Patron') and save 5. Repeat step 2 and notice the guarantorid value has not changed ---- See how child-update.pl currently behaves 6. Repeat steps 1-3 and on the child record select More > Update child to adult patron 7. In the child-update.pl window that loads select any patron category and save 8. Repeat step 2 and notice the guarantorid is now 0 ---- See how the patch fixes the behaviour of memberentry.pl 9. Apply patch 10. Repeat steps 1-5 and notice the guarantorid is now empty Sponsored-By: Brimbank Library, Australia Created attachment 91042 [details] [review] Bug 23224: Fix inconsistent behaviour of memberentry.pl When editing a child patron (in memberentry.pl) and changing their patron category to a non-child patron category Koha does not set the guarantorid to 0. This means we end up with non-child patrons with guarantors, which is currently not allowed by Koha. Whereas the behaviour in child-update.pl (which can be accessed from a patrons summary page by clicking 'More'->Update child to adult patron') sets the borrowers guarantorid value to 0. This is the correct behaiviour and is what memberentry.pl should be doing. This patch fixes that. Test plan: See how memberentry.pl currently behaves 1. Create a adult patron and select 'Add child' and create the child record. 2. Enter the Koha MySQL terminal and select the guarantorid value for the child record you just created: SELECT guarantorid FROM borrowers WHERE userid=<username>; 3. Notice the guarantorid is set to the adult patrons borrowernumber 4. On the child record select 'Edit' and in the memberentry.pl page change the category to any non-child patron category (for example 'Patron') and save 5. Repeat step 2 and notice the guarantorid value has not changed ---- See how child-update.pl currently behaves 6. Repeat steps 1-3 and on the child record select More > Update child to adult patron 7. In the child-update.pl window that loads select any patron category and save 8. Repeat step 2 and notice the guarantorid is now 0 ---- See how the patch fixes the behaviour of memberentry.pl 9. Apply patch 10. Repeat steps 1-5 and notice the guarantorid is now empty Sponsored-By: Brimbank Library, Australia Created attachment 91043 [details] [review] Bug 23224: Fix inconsistent behaviour of memberentry.pl When editing a child patron (in memberentry.pl) and changing their patron category to a non-child patron category Koha does not set the guarantorid to 0. This means we end up with non-child/non-professional patrons with guarantors, which is currently not allowed by Koha. Whereas the behaviour in child-update.pl (which can be accessed from a patrons summary page by clicking 'More'->Update child to adult patron') sets the borrowers guarantorid value to 0. This is the correct behaiviour and is what memberentry.pl should be doing. This patch fixes that. Test plan: See how memberentry.pl currently behaves 1. Create a adult patron and select 'Add child' and create the child record. 2. Enter the Koha MySQL terminal and select the guarantorid value for the child record you just created: SELECT guarantorid FROM borrowers WHERE userid=<username>; 3. Notice the guarantorid is set to the adult patrons borrowernumber 4. On the child record select 'Edit' and in the memberentry.pl page change the category to any non-child/non-professional patron category (for example 'Patron') and save 5. Repeat step 2 and notice the guarantorid value has not changed ---- See how child-update.pl currently behaves 6. Repeat steps 1-3 and on the child record select More > Update child to adult patron 7. In the child-update.pl window that loads select any patron category and save 8. Repeat step 2 and notice the guarantorid is now 0 ---- See how the patch fixes the behaviour of memberentry.pl 9. Apply patch 10. Repeat steps 1-5 and notice the guarantorid is now empty ---- Confirm the guarantorid is not removed when editing a patrons category to a patron category with the category type of 'professional' as in Koha professional patron categories can have guarantors 11. Repeat steps 1-3 and select 'Edit' on the childs record and change the patron category to a 'professional' patron category and then save 12. Check the database and confirm that the guarantorid is unchanged Sponsored-By: Brimbank Library, Australia Made a change to the patch so if you change from a 'child' to 'professional' patron category in memberentry.pl the guarantorid is not removed as Koha currently lets patron categories with the category type of 'professional' also have a guarantor. Created attachment 91109 [details] [review] Bug 23224: Fix inconsistent behaviour of memberentry.pl When editing a child patron (in memberentry.pl) and changing their patron category to a non-child patron category Koha does not set the guarantorid to 0. This means we end up with non-child/non-professional patrons with guarantors, which is currently not allowed by Koha. Whereas the behaviour in child-update.pl (which can be accessed from a patrons summary page by clicking 'More'->Update child to adult patron') sets the borrowers guarantorid value to 0. This is the correct behaiviour and is what memberentry.pl should be doing. This patch fixes that. Test plan: See how memberentry.pl currently behaves 1. Create a adult patron and select 'Add child' and create the child record. 2. Enter the Koha MySQL terminal and select the guarantorid value for the child record you just created: SELECT guarantorid FROM borrowers WHERE userid=<username>; 3. Notice the guarantorid is set to the adult patrons borrowernumber 4. On the child record select 'Edit' and in the memberentry.pl page change the category to any non-child/non-professional patron category (for example 'Patron') and save 5. Repeat step 2 and notice the guarantorid value has not changed ---- See how child-update.pl currently behaves 6. Repeat steps 1-3 and on the child record select More > Update child to adult patron 7. In the child-update.pl window that loads select any patron category and save 8. Repeat step 2 and notice the guarantorid is now 0 ---- See how the patch fixes the behaviour of memberentry.pl 9. Apply patch 10. Repeat steps 1-5 and notice the guarantorid is now empty ---- Confirm the guarantorid is not removed when editing a patrons category to a patron category with the category type of 'professional' as in Koha professional patron categories can have guarantors 11. Repeat steps 1-3 and select 'Edit' on the childs record and change the patron category to a 'professional' patron category and then save 12. Check the database and confirm that the guarantorid is unchanged Sponsored-By: Brimbank Library, Australia Signed-off-by: John Doe <you@example.com> oh ffs. Let me fix that signoff line. Created attachment 91110 [details] [review] Bug 23224: Fix inconsistent behaviour of memberentry.pl When editing a child patron (in memberentry.pl) and changing their patron category to a non-child patron category Koha does not set the guarantorid to 0. This means we end up with non-child/non-professional patrons with guarantors, which is currently not allowed by Koha. Whereas the behaviour in child-update.pl (which can be accessed from a patrons summary page by clicking 'More'->Update child to adult patron') sets the borrowers guarantorid value to 0. This is the correct behaiviour and is what memberentry.pl should be doing. This patch fixes that. Test plan: See how memberentry.pl currently behaves 1. Create a adult patron and select 'Add child' and create the child record. 2. Enter the Koha MySQL terminal and select the guarantorid value for the child record you just created: SELECT guarantorid FROM borrowers WHERE userid=<username>; 3. Notice the guarantorid is set to the adult patrons borrowernumber 4. On the child record select 'Edit' and in the memberentry.pl page change the category to any non-child/non-professional patron category (for example 'Patron') and save 5. Repeat step 2 and notice the guarantorid value has not changed ---- See how child-update.pl currently behaves 6. Repeat steps 1-3 and on the child record select More > Update child to adult patron 7. In the child-update.pl window that loads select any patron category and save 8. Repeat step 2 and notice the guarantorid is now 0 ---- See how the patch fixes the behaviour of memberentry.pl 9. Apply patch 10. Repeat steps 1-5 and notice the guarantorid is now empty ---- Confirm the guarantorid is not removed when editing a patrons category to a patron category with the category type of 'professional' as in Koha professional patron categories can have guarantors 11. Repeat steps 1-3 and select 'Edit' on the childs record and change the patron category to a 'professional' patron category and then save 12. Check the database and confirm that the guarantorid is unchanged Sponsored-By: Brimbank Library, Australia Signed-off-by: Liz Rea <liz@bywatersolutions.com> Created attachment 91115 [details] [review] Bug 23224: Fix inconsistent behaviour of memberentry.pl When editing a child patron (in memberentry.pl) and changing their patron category to a non-child patron category Koha does not set the guarantorid to 0. This means we end up with non-child/non-professional patrons with guarantors, which is currently not allowed by Koha. Whereas the behaviour in child-update.pl (which can be accessed from a patrons summary page by clicking 'More'->Update child to adult patron') sets the borrowers guarantorid value to 0. This is the correct behaiviour and is what memberentry.pl should be doing. This patch fixes that. Test plan: See how memberentry.pl currently behaves 1. Create a adult patron and select 'Add child' and create the child record. 2. Enter the Koha MySQL terminal and select the guarantorid value for the child record you just created: SELECT guarantorid FROM borrowers WHERE userid=<username>; 3. Notice the guarantorid is set to the adult patrons borrowernumber 4. On the child record select 'Edit' and in the memberentry.pl page change the category to any non-child/non-professional patron category (for example 'Patron') and save 5. Repeat step 2 and notice the guarantorid value has not changed ---- See how child-update.pl currently behaves 6. Repeat steps 1-3 and on the child record select More > Update child to adult patron 7. In the child-update.pl window that loads select any patron category and save 8. Repeat step 2 and notice the guarantorid is now 0 ---- See how the patch fixes the behaviour of memberentry.pl 9. Apply patch 10. Repeat steps 1-5 and notice the guarantorid is now empty ---- Confirm the guarantorid is not removed when editing a patrons category to a patron category with the category type of 'professional' as in Koha professional patron categories can have guarantors 11. Repeat steps 1-3 and select 'Edit' on the childs record and change the patron category to a 'professional' patron category and then save 12. Check the database and confirm that the guarantorid is unchanged Sponsored-By: Brimbank Library, Australia Signed-off-by: Liz Rea <liz@bywatersolutions.com> Signed-off-by: Nadine Pierre <nadine.pierre@inLibro.com> I am sorry, but I've managed to make this explode :( 1) Searched for a child patron 2) Added a guarantor 3) Edit patron 4) Switch patron category to "Patron" (Adult) 5) No property guarantorid for Koha::Patron at /usr/share/perl5/Exception/Class/Base.pm line 88 I believe this patch is no longer required - in master, guarantors and guarantees are stored in borrower_relationships in the database. the relationship information is deleted when changing from child patron to adult patron using memberentry.pl and child-update.pl. Closing bug report |