@@ -, +, @@ 1) Go to system preferences and make borrowerRelationship empty. 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. Try to save your changes. 4) Observe that relationship field is required in order to save but you can't actually choose anything as it doesn't contain anything. 5) Apply the patch. 6) Repeat steps above. 7) Observe that it allows you to save the form now. 1) Go to system preferences and set borrowerRelationship exactly to "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. 4) Observe that there's no option to leave relationship field empty. 5) Apply the patch. 6) Repeat steps above. 7) Observe that it has empty option that you can choose and save the form. --- members/memberentry.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/members/memberentry.pl +++ a/members/memberentry.pl @@ -107,8 +107,8 @@ 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; +my @relations = split /,|\|/, C4::Context->preference('borrowerRelationship'), -1; +my $empty_relationship_allowed = grep {$_ eq ""} (@relations || ''); $template->param( empty_relationship_allowed => $empty_relationship_allowed ); my $guarantor_id = $input->param('guarantor_id'); --