Bugzilla – Attachment 98225 Details for
Bug 24554
Only embed relations from Koha::Biblio in to_api
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24554: Only embed relations from Koha::Biblio in to_api
Bug-24554-Only-embed-relations-from-KohaBiblio-in-.patch (text/plain), 1.61 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-01-31 12:11:20 UTC
(
hide
)
Description:
Bug 24554: Only embed relations from Koha::Biblio in to_api
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-01-31 12:11:20 UTC
Size:
1.61 KB
patch
obsolete
>From c2cdec3e26842bbc1726ee3778ea260282ca5644 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Fri, 31 Jan 2020 09:06:51 -0300 >Subject: [PATCH] Bug 24554: Only embed relations from Koha::Biblio in to_api > >This patch simplifies the behaviour of Koha::Biblio->to_api. It was >designed with the idea of handling possible methods that would be added >to Koha::Biblioitem. But it had a weird fallback behaviour was >highlighted by using it with bug 24528. > >On fixing it it become obvious that it was unnessessarily complex and >that it was not worth. That's the reason there wasn't any test for it, >as Koha::Biblioitem doesn't implement any extra methods. > >To test: >1. Run: > $ kshell > k$ prove t/db_dependent/Koha/Biblio.t >=> SUCCESS: Tests pass >2. Apply this patch >3. Repeat (1) >=> SUCCESS: Tests pass! >4. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Biblio.pm | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index d8d1f09a3c..d693f2fc7c 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -785,16 +785,8 @@ on the API. > sub to_api { > my ($self, $args) = @_; > >- my @embeds = keys %{ $args->{embed} }; >- my $remaining_embeds = {}; >- >- foreach my $embed (@embeds) { >- $remaining_embeds = delete $args->{embed}->{$embed} >- unless $self->can($embed); >- } >- > my $response = $self->SUPER::to_api( $args ); >- my $biblioitem = $self->biblioitem->to_api({ embed => $remaining_embeds }); >+ my $biblioitem = $self->biblioitem->to_api; > > return { %$response, %$biblioitem }; > } >-- >2.25.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24554
:
98225
|
98266
|
98519