Bug 37262: Fix for unmapped tablename filtering

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: amended to tidy the new code (tcohen)
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Pedro Amorim 2024-07-05 12:10:16 +00:00 committed by Katrin Fischer
parent 263cd36541
commit 2fb123d2db
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 8 additions and 1 deletions

View File

@ -53,9 +53,13 @@ sub list {
return try {
my $additional_fields_set = Koha::AdditionalFields->new;
if ($resource_type) {
if ( $resource_type && $resource_to_table->{$resource_type} ) {
$additional_fields_set =
$additional_fields_set->search( { tablename => $resource_to_table->{$resource_type} } );
} elsif ($resource_type) {
$additional_fields_set = $additional_fields_set->search( { tablename => $resource_type } );
} else {
$additional_fields_set = $additional_fields_set->search();
}
return $c->render(

View File

@ -17,6 +17,9 @@
- basket
- invoice
- order
- subscription
- accountlines:credit
- accountlines:debit
- $ref: "../swagger.yaml#/parameters/match"
- $ref: "../swagger.yaml#/parameters/order_by"
- $ref: "../swagger.yaml#/parameters/page"