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

(-)a/Koha/Object.pm (-1 / +12 lines)
Lines 878-890 sub attributes_from_api { Link Here
878
    my $params;
878
    my $params;
879
    my $columns_info = $self->_result->result_source->columns_info;
879
    my $columns_info = $self->_result->result_source->columns_info;
880
880
881
    if ( ref($from_api_params) && ref($from_api_params) eq 'ARRAY' ) {
882
        # TODO No fixup if an ARRAY is passed
883
        return $from_api_params;
884
    }
885
881
    while ( my ( $key, $value ) = each %{$from_api_params} ) {
886
    while ( my ( $key, $value ) = each %{$from_api_params} ) {
882
        my $koha_field_name =
887
        my $koha_field_name =
883
            exists $from_api_mapping->{$key}
888
            exists $from_api_mapping->{$key}
884
            ? $from_api_mapping->{$key}
889
            ? $from_api_mapping->{$key}
885
            : $key;
890
            : $key;
886
891
887
        $params->{$koha_field_name} = $self->_recursive_fixup( $key, $value, $columns_info->{$koha_field_name} );
892
        if ( exists $columns_info->{$koha_field_name}  ) {
893
            # TODO No fixup if the name is from an embed (eg. suggester.borrowernumber)
894
            # See warnings produced by t/db_dependent/Koha/REST/Plugin/Objects.t if this test is removed
895
            $params->{$koha_field_name} = $self->_recursive_fixup( $key, $value, $columns_info->{$koha_field_name} );
896
        } else {
897
            $params->{$koha_field_name} = $value;
898
        }
888
    }
899
    }
889
900
890
    return $params;
901
    return $params;
(-)a/Koha/REST/Plugin/Objects.pm (-3 / +3 lines)
Lines 284-291 controller, and thus shouldn't be called twice in it. Link Here
284
                );
284
                );
285
            }
285
            }
286
286
287
            $filtered_params =
287
            if ( defined $filtered_params ) {
288
                  $result_set->attributes_from_api($filtered_params);
288
                $filtered_params = $result_set->attributes_from_api($filtered_params);
289
            }
289
290
290
            $c->dbic_validate_operators( { filtered_params => $filtered_params } );
291
            $c->dbic_validate_operators( { filtered_params => $filtered_params } );
291
292
292
- 

Return to bug 37902