https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25322
Peter Vashchuk <stalkern...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |stalkern...@gmail.com --- Comment #7 from Peter Vashchuk <stalkern...@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. _______________________________________________ Koha-bugs mailing list Koha-bugs@lists.koha-community.org 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/