View | Details | Raw Unified | Return to bug 18887
Collapse All | Expand All

(-)a/C4/Reserves.pm (-1 / +1 lines)
Lines 427-433 sub CanItemBeReserved { Link Here
427
            rule_name    => 'max_holds',
427
            rule_name    => 'max_holds',
428
        }
428
        }
429
    );
429
    );
430
    if ( $rule ) {
430
    if ( $rule && defined( $rule->rule_value ) && $rule->rule_value ne '' ) {
431
        my $total_holds_count = Koha::Holds->search(
431
        my $total_holds_count = Koha::Holds->search(
432
            {
432
            {
433
                borrowernumber => $borrower->{borrowernumber}
433
                borrowernumber => $borrower->{borrowernumber}
(-)a/admin/smart-rules.pl (-1 / +1 lines)
Lines 228-234 elsif ($op eq "set-branch-defaults") { Link Here
228
    $holdallowed =~ s/\s//g;
228
    $holdallowed =~ s/\s//g;
229
    $holdallowed = undef if $holdallowed !~ /^\d+/;
229
    $holdallowed = undef if $holdallowed !~ /^\d+/;
230
    $max_holds =~ s/\s//g;
230
    $max_holds =~ s/\s//g;
231
    $max_holds = undef if $max_holds !~ /^\d+/;
231
    $max_holds = '' if $max_holds !~ /^\d+/;
232
232
233
    if ($branch eq "*") {
233
    if ($branch eq "*") {
234
        my $sth_search = $dbh->prepare("SELECT count(*) AS total
234
        my $sth_search = $dbh->prepare("SELECT count(*) AS total
(-)a/installer/data/mysql/atomicupdate/bug_18887.perl (-2 / +2 lines)
Lines 20-31 if( CheckVersion( $DBversion ) ) { Link Here
20
20
21
    $dbh->do(q{
21
    $dbh->do(q{
22
        INSERT INTO circulation_rules ( branchcode, categorycode, itemtype, rule_name, rule_value )
22
        INSERT INTO circulation_rules ( branchcode, categorycode, itemtype, rule_name, rule_value )
23
        SELECT branchcode, categorycode, NULL, 'max_holds', max_holds FROM branch_borrower_circ_rules
23
        SELECT branchcode, categorycode, NULL, 'max_holds', COALESCE( max_holds, '' ) FROM branch_borrower_circ_rules
24
    });
24
    });
25
25
26
    $dbh->do(q{
26
    $dbh->do(q{
27
        INSERT INTO circulation_rules ( branchcode, categorycode, itemtype, rule_name, rule_value )
27
        INSERT INTO circulation_rules ( branchcode, categorycode, itemtype, rule_name, rule_value )
28
        SELECT NULL, categorycode, NULL, 'max_holds', max_holds FROM branch_borrower_circ_rules
28
        SELECT NULL, categorycode, NULL, 'max_holds', COALESCE( max_holds, '' ) FROM default_borrower_circ_rules
29
    });
29
    });
30
30
31
    $dbh->do(q{
31
    $dbh->do(q{
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt (-2 / +1 lines)
Lines 520-526 Link Here
520
                        </td>
520
                        </td>
521
                        <td>
521
                        <td>
522
                            [% SET rule_value = CirculationRules.Get( branch_cat_rule_loo.branchcode, branch_cat_rule_loo.categorycode, branch_cat_rule_loo.itemtype, 'max_holds' ) %]
522
                            [% SET rule_value = CirculationRules.Get( branch_cat_rule_loo.branchcode, branch_cat_rule_loo.categorycode, branch_cat_rule_loo.itemtype, 'max_holds' ) %]
523
                            [% IF rule_value  %]
523
                            [% IF rule_value.defined && rule_value != '' %]
524
                                [% rule_value %]
524
                                [% rule_value %]
525
                            [% ELSE %]
525
                            [% ELSE %]
526
                                Unlimited
526
                                Unlimited
527
- 

Return to bug 18887