Bug 39397: 'biblio' attributes take precedence over 'biblioitems' in response

This patch swaps biblio for biblioitem attributes in the return value.
The effect is that attributes from the `biblio` table overwrite those
named the same (`timestamp` being the target).

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/biblios.t
=> FAIL: The biblioitems.timestamp is returned!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Things go smooth now
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Tomas Cohen Arazi 2025-03-21 10:52:45 -03:00 committed by Katrin Fischer
parent 419d708666
commit f69aab3735
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 1 additions and 1 deletions

View File

@ -1735,7 +1735,7 @@ sub to_api {
my $json_biblioitem = $biblioitem->to_api($args);
return unless $json_biblioitem;
return { %$json_biblio, %$json_biblioitem };
return { %$json_biblioitem, %$json_biblio };
}
=head3 to_api_mapping