@@ -, +, @@ father 1) Create a new patron who is assumed to have a guarantor or modify the existing one. 2) Under "Guarantor Information" click on "Search to add" button. After performing the search, select a user to act as guarantor. Don't use the dropdown menu to select a relationship. Save your changes. 3) Observe that relationship is set as "father". 4) Apply the patch. 5) Repeat steps 1 and 2. 6) Observe that it doesn't allow you to save the form until you pick a relationship type. 1) Add an empty entry to borrowerRelationship at /cgi-bin/koha/admin/preferences.pl?tab=patrons in Patron relationships section (example: "|father|mother"). 2) Create a new patron who is assumed to have a guarantor or modify the existing one. 3) Under "Guarantor Information" click on "Search to add" button. After performing the search, select a user to act as guarantor. Don't use the dropdown menu to select a relationship. Save your changes. 4) Observe that relationship is set as "father". 5) Apply the patch. 6) Repeat steps 1, 2 and 3. 7) Observe when you save the empty entry it does set the relationship as empty. --- .../prog/en/modules/members/memberentrygen.tt | 34 +++++++++++++++---- members/memberentry.pl | 4 +++ 2 files changed, 32 insertions(+), 6 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -477,12 +477,23 @@ legend:hover {
  • - - + [% ELSE %] + + + [% UNLESS empty_relationship_allowed %] + Required + [% END %]
  • @@ -513,12 +524,23 @@ legend:hover {
  • - - + [% ELSE %] + + + [% UNLESS empty_relationship_allowed %] + Required + [% END %]
  • --- a/members/memberentry.pl +++ a/members/memberentry.pl @@ -107,6 +107,10 @@ my @messages; ## Deal with guarantor stuff $template->param( relationships => scalar $patron->guarantor_relationships ) if $patron; +my @relations = split /,|\|/, C4::Context->preference('borrowerRelationship'); +my $empty_relationship_allowed = grep {$_ eq ""} @relations; +$template->param( empty_relationship_allowed => $empty_relationship_allowed ); + my $guarantor_id = $input->param('guarantor_id'); my $guarantor = undef; $guarantor = Koha::Patrons->find( $guarantor_id ) if $guarantor_id; --