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; |