[Koha-bugs] [Bug 25322] Adding a guarantor with no relationship defaults to father
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Tue May 5 15:41:25 CEST 2020
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25322
Peter Vashchuk <stalkernoid at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |stalkernoid at gmail.com
--- Comment #7 from Peter Vashchuk <stalkernoid at gmail.com> ---
Yes, there is <select> with 2 defined options: father and mother.
When I added empty <option> and tried to save the form I got 500 error "Invalid
relationship passed, '' is not defined.", because:
File: /Koha/Patron/Relationship.pm
53: Koha::Exceptions::Patron::Relationship::InvalidRelationship->throw(
54: no_relationship => 1 )
55: unless defined $self->relationship;
56:
57: Koha::Exceptions::Patron::Relationship::InvalidRelationship->throw(
58: relationship => $self->relationship )
59: unless any { $_ eq $self->relationship } @valid_relationships;
Which means there is no possibility to store empty relationship, as well any
relationship should be in @valid_relationships.
My proposal is to anyway append empty <option selected></option>, and then
either:
- if mandatory: perform form validation and force user to choose one of the
defined options,
- if relationship is not mandatory, then the code above (line 53-55) should be
changed to allow storing empty relationship (but I am not sure about business
logic)
I can implement any of these, but I need your expertise to decide which is the
correct one.
--
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
More information about the Koha-bugs
mailing list