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

(-)a/C4/HoldsQueue.pm (-2 / +9 lines)
Lines 564-574 sub debug { Link Here
564
#   warn @_;
564
#   warn @_;
565
}
565
}
566
566
567
sub _trim {
568
    return $_[0] unless $_[0];
569
    $_[0] =~ s/^\s+//;
570
    $_[0] =~ s/\s+$//;
571
    $_[0];
572
}
573
567
sub load_branches_to_pull_from {
574
sub load_branches_to_pull_from {
568
    my $static_branch_list = C4::Context->preference("StaticHoldsQueueWeight")
575
    my $static_branch_list = C4::Context->preference("StaticHoldsQueueWeight")
569
      or return;
576
      or return;
570
577
571
    my @branches_to_use = map { s/^\s+//; s/\s+$//; $_; } split /,/, $static_branch_list;
578
    my @branches_to_use = map _trim($_), split /,/, $static_branch_list;
572
579
573
    @branches_to_use = shuffle(@branches_to_use) if  C4::Context->preference("RandomizeHoldsQueueWeight");
580
    @branches_to_use = shuffle(@branches_to_use) if  C4::Context->preference("RandomizeHoldsQueueWeight");
574
581
Lines 590-595 sub least_cost_branch { Link Here
590
        next if $cell->{disable_transfer};
597
        next if $cell->{disable_transfer};
591
598
592
        my $cost = $cell->{cost};
599
        my $cost = $cell->{cost};
600
        next unless defined $cost; # XXX should this be reported?
593
601
594
        unless (defined $least_cost) {
602
        unless (defined $least_cost) {
595
            $least_cost = $cost;
603
            $least_cost = $cost;
596
- 

Return to bug 5911