Bug 35421 - Is "A guarantor cannot be a guarantee." still correct?
Summary: Is "A guarantor cannot be a guarantee." still correct?
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 12133
Blocks:
  Show dependency treegraph
 
Reported: 2023-11-28 15:03 UTC by Katrin Fischer
Modified: 2024-10-11 20:27 UTC (History)
6 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

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2023-11-28 15:03:17 UTC
With the ability to have adults guarantee for adults, I believe the above might no longer be true.

Found while translating in koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt:190
Comment 1 Emmi Takkinen 2023-11-29 06:33:24 UTC
This error is triggered when patron added as guarantor is a child OR has categorycode which has setting "can_be_guarantee" on. So it's still valid.
Comment 2 Katrin Fischer 2023-11-29 08:54:57 UTC
I am pretty sure I have recently build a "chained" construct with 3 patrons guaranteeing for each other when testing another bug. That's why I am confused. 

Bug 32980 - Checkouts for guarantees are not shown if patron also has a guarantor

We need to come to a conclusion how these things are supposed to work.
Comment 3 Emmi Takkinen 2023-11-29 11:27:36 UTC
(In reply to Katrin Fischer from comment #2)
> I am pretty sure I have recently build a "chained" construct with 3 patrons
> guaranteeing for each other when testing another bug. That's why I am
> confused. 
> 
> Bug 32980 - Checkouts for guarantees are not shown if patron also has a
> guarantor
> 
> We need to come to a conclusion how these things are supposed to work.

Hmm, could you describe what you did a bit more? And did you have syspref "ChildNeedsGuarantor" enabled when doing this?
Comment 4 Emmi Takkinen 2023-11-29 12:43:43 UTC
As a side note, I realized that we don't really need to check if patron is child when "ChildNeedsGuarantor" is enabled. It's enough to check if patrons category has "Can be guarantee" set.

Secondly, I'm now second guessing this line:

if ( ( $op eq 'save' || $op eq 'insert' ) && $guarantor->is_child || $guarantor->category->can_be_guarantee ) {
        push @errors, 'ERROR_guarantor_is_guarantee';
}

In this too, we could get rid of $guarantor->is_child. And yeah, I can see where the confusion comes. This doesn't prevent all situations where of someone being both guarantee and guarantor. They can be also guarantor as long as their category type doesn't have "Can be guarantee" set.    

And "ChildNeedsGuarantor" and error "Child patron needs guarantor." have to be changed.

Actually, I'm not sure anymore if "ChildNeedsGuarantor" should be a global syspref. Instead it should be category specific like "Can be guarantee" (something like "Guarantor is mandatory"). It would be more flexible.
Comment 5 Fridolin Somers 2024-08-06 13:53:48 UTC
Button "+ add guarantee" appears when patron.is_adult
meaning in category type A or I.

This must depend on patron category having not "Can be guarantee" right ?
Comment 6 Katrin Fischer 2024-08-06 13:55:35 UTC
(In reply to Fridolin Somers from comment #5)
> Button "+ add guarantee" appears when patron.is_adult
> meaning in category type A or I.
> 
> This must depend on patron category having not "Can be guarantee" right ?

I think you are right.
Comment 7 Marie-Luce Laflamme 2024-10-11 20:27:39 UTC
There’s another bug related to patrons in the same category not being able to be guarantor and guarantee. Maybe it would be worth waiting for that fix before making any decisions.


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=37892