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 (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-28 15:03 UTC by Katrin Fischer
Modified: 2023-11-29 12:43 UTC (History)
4 users (show)

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


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.