Bug 38892 - Patron category 'can be a guarantee' means that same category cannot be a guarantor (again)
Summary: Patron category 'can be a guarantee' means that same category cannot be a gua...
Status: Passed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Hammat wele
QA Contact: Nick Clemens (kidclamp)
URL:
Keywords:
Depends on: 12133
Blocks:
  Show dependency treegraph
 
Reported: 2025-01-14 17:32 UTC by Caroline Cyr La Rose
Modified: 2025-02-11 14:14 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 38892: Show correct error message when we attempt to add guarantor as a child (2.78 KB, patch)
2025-01-15 20:05 UTC, Hammat wele
Details | Diff | Splinter Review
Bug 38892: Show correct error message when we attempt to add guarantor as a child (2.83 KB, patch)
2025-01-24 21:38 UTC, David Nind
Details | Diff | Splinter Review
Bug 38892: Show correct error message when we attempt to add guarantor as a child (2.88 KB, patch)
2025-02-07 14:26 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2025-01-14 17:32:18 UTC
I think this was not completely fixed in bug 37892. When adding a patron, you cannot choose a guarantor with the same category.

To recreate:
1, Go to Patrons
2. Click 'New patron' > 'Kid'
3. Fill out surname and cardnumber
4. Under Patron guarantor, click Add guarantor
5. Search for category = Kid and choose one of the patrons
6. Choose the relationship
7. Click 'Save'
   --> Error A guarantor cannot be a guarantee.

This patron is not a guarantor. This error does not make sense.

***Note that it also blocks editing a patron that has the same category as their guarantor when coming from an upgrade!*** I think this a major, if not critical.

I get that the example with 'Kid' does not make much sense, but I just wanted to avoid having to go into patron categories to change the 'Patron' category for example to 'can be guarantee' and make the example with two 'Patron' patrons.

Not all libraries classify their patrons with kid/adult. It might be resident/non-resident for example, and a resident parent could have a resident guarantee.
Comment 1 Blou 2025-01-14 19:24:35 UTC
Il also blocks update_patrons_category.pl from completing the change of category
Comment 2 Caroline Cyr La Rose 2025-01-14 19:25:45 UTC
We also noticed that this causes problems when a guarantee changes category using the script update_patrons_category.pl and is now in the same category as their guarantor.
Comment 3 Hammat wele 2025-01-15 20:05:00 UTC
Created attachment 176585 [details] [review]
Bug 38892: Show correct error message when we attempt to add guarantor as a child

When we attempt to add child as guarantor the error message shown is 'A guarantor cannot be a guarantee.' it doesn't make sense

To recreate:
1. Go to Patrons
2. Click 'New patron' > 'Kid'
3. Fill out surname and cardnumber
4. Under Patron guarantor, click Add guarantor
5. Search for category = Kid and choose one of the patrons
6. Choose the relationship
7. Click 'Save'
   --> Error A guarantor cannot be a guarantee.
8. Apply the patch
9. repeat previous steps
10. After clicking Save
   --> the error message shown is «Child patron cannot be a guarantor.»
Comment 4 David Nind 2025-01-24 21:38:49 UTC
Created attachment 177134 [details] [review]
Bug 38892: Show correct error message when we attempt to add guarantor as a child

When we attempt to add child as guarantor the error message shown is 'A guarantor cannot be a guarantee.' it doesn't make sense

To recreate:
1. Go to Patrons
2. Click 'New patron' > 'Kid'
3. Fill out surname and cardnumber
4. Under Patron guarantor, click Add guarantor
5. Search for category = Kid and choose one of the patrons
6. Choose the relationship
7. Click 'Save'
   --> Error A guarantor cannot be a guarantee.
8. Apply the patch
9. repeat previous steps
10. After clicking Save
   --> the error message shown is «Child patron cannot be a guarantor.»

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2025-01-24 21:42:30 UTC
I've tested, things work as per the test plan, so I've signed off.

However, I'm a bit confused with this, reflecting that this area has gotten complicated!

Are we saying:
- At the moment (even after bug 37892), a patron can't be a guarantor for a patron in the same patron category - and that they should be able to be? 
- Or that they should be able to be a guarantor, as long as the patron category is not a "Category type" of "Child"?
Comment 6 Nick Clemens (kidclamp) 2025-02-07 14:26:52 UTC
Created attachment 177628 [details] [review]
Bug 38892: Show correct error message when we attempt to add guarantor as a child

When we attempt to add child as guarantor the error message shown is 'A guarantor cannot be a guarantee.' it doesn't make sense

To recreate:
1. Go to Patrons
2. Click 'New patron' > 'Kid'
3. Fill out surname and cardnumber
4. Under Patron guarantor, click Add guarantor
5. Search for category = Kid and choose one of the patrons
6. Choose the relationship
7. Click 'Save'
   --> Error A guarantor cannot be a guarantee.
8. Apply the patch
9. repeat previous steps
10. After clicking Save
   --> the error message shown is «Child patron cannot be a guarantor.»

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 7 Nick Clemens (kidclamp) 2025-02-07 14:28:38 UTC
Passing QA - the patches do what they say and the test plan works, however, the patches don't match the bug title. I cannot recreate Caroline's issue though. Two categories marked as 'Can be guarantee' and I am able to assign a relationship between two in the same category, or either way between categories.

Can you write a test plan not involving child categories to help recreate Caroline?