rule_name => 'max_holds',
}
);
- if ( $rule ) {
+ if ( $rule && defined( $rule->rule_value ) && $rule->rule_value ne '' ) {
my $total_holds_count = Koha::Holds->search(
{
borrowernumber => $borrower->{borrowernumber}
$holdallowed =~ s/\s//g;
$holdallowed = undef if $holdallowed !~ /^\d+/;
$max_holds =~ s/\s//g;
- $max_holds = undef if $max_holds !~ /^\d+/;
+ $max_holds = '' if $max_holds !~ /^\d+/;
if ($branch eq "*") {
my $sth_search = $dbh->prepare("SELECT count(*) AS total
$dbh->do(q{
INSERT INTO circulation_rules ( branchcode, categorycode, itemtype, rule_name, rule_value )
- SELECT branchcode, categorycode, NULL, 'max_holds', max_holds FROM branch_borrower_circ_rules
+ SELECT branchcode, categorycode, NULL, 'max_holds', COALESCE( max_holds, '' ) FROM branch_borrower_circ_rules
});
$dbh->do(q{
INSERT INTO circulation_rules ( branchcode, categorycode, itemtype, rule_name, rule_value )
- SELECT NULL, categorycode, NULL, 'max_holds', max_holds FROM branch_borrower_circ_rules
+ SELECT NULL, categorycode, NULL, 'max_holds', COALESCE( max_holds, '' ) FROM default_borrower_circ_rules
});
$dbh->do(q{