Bugzilla – Attachment 98266 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.65 KB, created by
David Nind
on 2020-02-01 20:23:22 UTC
(
hide
)
Description:
Bug 24554: Only embed relations from Koha::Biblio in to_api
Filename:
MIME Type:
Creator:
David Nind
Created:
2020-02-01 20:23:22 UTC
Size:
1.65 KB
patch
obsolete
>From 7c25d295731840df5ec5e16b9284296abf7ff4bd 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> > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/Biblio.pm | 10 +--------- > 1 file changed, 1 insertion(+), 9 deletions(-) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index d5fe1f9fa6..9ddfa0c910 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.11.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