Bug 25946: borrowerRelationship can be empty
Do not split the config using comma. From syspref description of borrowerRelationship preference: > Guarantors can be the following of those they guarantee: > (input multiple choices separated by |). Leave empty to deactivate. As it doesn't mention comma at all, I removed ',' from split. Of course if comma is actually a viable way to split separate choices, I can obsolete this patch and append to the syspref description that it also can be separated by comma. Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
7697cc23b2
commit
4490dfdf08
|
|
@ -48,7 +48,7 @@ Overloaded method that makes some checks before storing on the DB
|
|||
sub store {
|
||||
my ( $self ) = @_;
|
||||
|
||||
my @valid_relationships = split /,|\|/, C4::Context->preference('borrowerRelationship');
|
||||
my @valid_relationships = split /\|/, C4::Context->preference('borrowerRelationship');
|
||||
|
||||
Koha::Exceptions::Patron::Relationship::InvalidRelationship->throw(
|
||||
no_relationship => 1 )
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ my @messages;
|
|||
## Deal with guarantor stuff
|
||||
$template->param( relationships => scalar $patron->guarantor_relationships ) if $patron;
|
||||
|
||||
my @relations = split /,|\|/, C4::Context->preference('borrowerRelationship');
|
||||
my @relations = split /\|/, C4::Context->preference('borrowerRelationship');
|
||||
my $empty_relationship_allowed = grep {$_ eq ""} @relations;
|
||||
$template->param( empty_relationship_allowed => $empty_relationship_allowed );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue