https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39014
--- Comment #16 from Emmi Takkinen <[email protected]> --- (In reply to Marcel de Rooy from comment #15) > QA Comment: > Thx for your patch ! > > Koha::Patron->validate_guarantor( \@guarantors, $newdata{'contactname'}, > $category ); > validate_guarantor is a CLASS method ! > Should we at least reflect that in the code by renaming to $class ? Or > should we default to checking guarantor_relationships when you would pass a > patron in $self ? I don't quite get what you mean with this, could you explain this some more? > =head3 validate_guarantor > Koha::Patron->validate_guarantor(\@guarantors, $contactname, $category ); > Validates guarantor patron. > =cut > Could you elaborate "validate guarantor patron"? Singular ? You're right, method should be named validate_guarantors and description of the method should be more descriptive. > Having the impression that we do two separate things here? FIrst we check > ChildNeedsGuarantor, which is not really validating guarantors, right? And > secondly we walk thru all guarantors (which is the name of the sub). > > How can this test on patron work in all cases? > if ( ( $op eq 'cud-save' || $op eq 'cud-insert' ) ) { > unless ( $patron && $patron->is_guarantor ) { > [etc] > } else { > push @errors, "ERROR_guarantee_is_guarantor"; > } > } Hmm, I guess these should be two separate methods then? One for validating guarantors and one for checking if patron needs a guarantor. > Test adding a regular patron: > [2025/05/30 09:06:36] [WARN] L291 at /usr/share/koha/members/memberentry.pl > line 291. > Test modify a guarantor: > The following fields are wrong. Please fix them. > A guarantor cannot be a guarantee. > The patron is no guarantee! The test here is WRONG. Did this happen while adding patron from Koha or while running tests? Could you provide a plan how to reproduce this? -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list [email protected] https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
