Bug 38841 - Guarantor does not check non members guarantor while deleting with ChildNeedsGuarantor
Summary: Guarantor does not check non members guarantor while deleting with ChildNeeds...
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Baptiste Wojtkowski (bwoj)
QA Contact: Lisette Scheer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-07 15:49 UTC by Baptiste Wojtkowski (bwoj)
Modified: 2025-05-21 14:10 UTC (History)
5 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This patch allows a librarian to replace a member guarantor with a non-member guarantor. Before this patch, saving a child's profile with the "delete [this guarantor]" box checked and the data entered in the non-member guarantor field resulted in an error because koha refused to delete the last guarantor.
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 38841: Check non-patron guarantor while deleting patron guarantor (1.99 KB, patch)
2025-01-07 16:01 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 38841: Check non-patron guarantor while deleting patron guarantor (2.05 KB, patch)
2025-01-14 12:58 UTC, Thibault Keromnès
Details | Diff | Splinter Review
Bug 38841: Check non-patron guarantor while deleting patron guarantor (2.11 KB, patch)
2025-02-28 18:13 UTC, Lisette Scheer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Baptiste Wojtkowski (bwoj) 2025-01-07 15:49:10 UTC
Steps to reproduce:
1 - Edit a Child, add a guarantor and a non-member guarantor
2 - Try to remove the guarantor while letting the non-member guarantor -> you cannot
Comment 1 Baptiste Wojtkowski (bwoj) 2025-01-07 16:01:34 UTC
Created attachment 176200 [details] [review]
Bug 38841: Check non-patron guarantor while deleting patron guarantor

When editing a child while Childneedsquarantor active, trying to delete
a guarantor while saving a non-patron guarantor will prevent the user
from saving. However, if an adult has expired, some librarian would like
to remove the account and let some information in non-patron guarantor.

TEST PLAN

Before applying patch
1 - Open Lisa Charles'page, add Henry Acevedo as Guarantor, also fill
  Guarantor surname and firstname
2 - Edit the page and try and remove Henry Acevedo, it won't work
  however there is still one guarantor

3 - Apply patch
4 - Try and remove Henry Acevedo -> it will work
5 - add HA as a guarantor again
6 - try and remove him AND let guarantor firstname and surname empty ->
  you can't
7 - Add HA and Edna Acosta as guarantor
8 - Remove HA and ler guarantor firstname and surname empty -> you can
Comment 2 Thibault Keromnès 2025-01-14 12:58:34 UTC
Created attachment 176500 [details] [review]
Bug 38841: Check non-patron guarantor while deleting patron guarantor

When editing a child while Childneedsquarantor active, trying to delete
a guarantor while saving a non-patron guarantor will prevent the user
from saving. However, if an adult has expired, some librarian would like
to remove the account and let some information in non-patron guarantor.

TEST PLAN

Before applying patch
1 - Open Lisa Charles'page, add Henry Acevedo as Guarantor, also fill
  Guarantor surname and firstname
2 - Edit the page and try and remove Henry Acevedo, it won't work
  however there is still one guarantor

3 - Apply patch
4 - Try and remove Henry Acevedo -> it will work
5 - add HA as a guarantor again
6 - try and remove him AND let guarantor firstname and surname empty ->
  you can't
7 - Add HA and Edna Acosta as guarantor
8 - Remove HA and ler guarantor firstname and surname empty -> you can

Signed-off-by: Thibault Keromnes <thibault.keromnes@univ-paris8.fr>
Comment 3 mteal 2025-02-20 18:03:35 UTC
While we're waiting for this fix, does anyone have a workaround?
Comment 4 Baptiste Wojtkowski (bwoj) 2025-02-27 14:15:24 UTC
You can temporarily disable the syspref ChildNeedsGuarantor before editing a child, or apply temporarily this patch
Comment 5 Lisette Scheer 2025-02-28 18:13:13 UTC
Created attachment 178868 [details] [review]
Bug 38841: Check non-patron guarantor while deleting patron guarantor

When editing a child while Childneedsquarantor active, trying to delete
a guarantor while saving a non-patron guarantor will prevent the user
from saving. However, if an adult has expired, some librarian would like
to remove the account and let some information in non-patron guarantor.

Worked as expected!

TEST PLAN

Before applying patch
1 - Open Lisa Charles'page, add Henry Acevedo as Guarantor, also fill
  Guarantor surname and firstname
2 - Edit the page and try and remove Henry Acevedo, it won't work
  however there is still one guarantor

3 - Apply patch
4 - Try and remove Henry Acevedo -> it will work
5 - add HA as a guarantor again
6 - try and remove him AND let guarantor firstname and surname empty ->
  you can't
7 - Add HA and Edna Acosta as guarantor
8 - Remove HA and ler guarantor firstname and surname empty -> you can

Signed-off-by: Thibault Keromnes <thibault.keromnes@univ-paris8.fr>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Comment 6 Katrin Fischer 2025-03-07 14:02:30 UTC
Can you please add some info to the release notes? Change makes sense, but it will be good to inform.
Comment 7 Katrin Fischer 2025-03-07 14:42:48 UTC
Pushed for 25.05!

Well done everyone, thank you!