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

(-)a/C4/Stats.pm (-5 / +4 lines)
Lines 94-100 sub UpdateStats { Link Here
94
94
95
    my @mandatory_keys = ();
95
    my @mandatory_keys = ();
96
    if (! exists $params->{type} or ! defined $params->{type}) {
96
    if (! exists $params->{type} or ! defined $params->{type}) {
97
        croak ("UpdateStats does not received type param");
97
        croak ("UpdateStats did not received type param");
98
    }
98
    }
99
    if (grep ($_ eq $params->{type}, @allowed_circulation_types  )) {
99
    if (grep ($_ eq $params->{type}, @allowed_circulation_types  )) {
100
        @mandatory_keys = @circulation_mandatory_keys;
100
        @mandatory_keys = @circulation_mandatory_keys;
Lines 105-117 sub UpdateStats { Link Here
105
    }
105
    }
106
    my @missing_params = ();
106
    my @missing_params = ();
107
    for my $mykey (@mandatory_keys ) {
107
    for my $mykey (@mandatory_keys ) {
108
        push @missing_params, $mykey if !grep (/^$mykey/, keys $params);
108
        push @missing_params, $mykey if !grep (/^$mykey/, keys %$params);
109
    }
109
    }
110
    if (scalar @missing_params > 0 ) {
110
    if (scalar @missing_params > 0 ) {
111
        croak ("UpdateStats does not received mandatory param(s): ".join (", ",@missing_params ));
111
        croak ("UpdateStats did not received mandatory param(s): ".join (", ",@missing_params ));
112
    }
112
    }
113
    my @invalid_params = ();
113
    my @invalid_params = ();
114
    for my $myparam (keys $params ) {
114
    for my $myparam (keys %$params ) {
115
        push @invalid_params, $myparam unless grep (/^$myparam$/, @allowed_keys);
115
        push @invalid_params, $myparam unless grep (/^$myparam$/, @allowed_keys);
116
    }
116
    }
117
    if (scalar @invalid_params > 0 ) {
117
    if (scalar @invalid_params > 0 ) {
118
- 

Return to bug 11230