Bugzilla – Attachment 133328 Details for
Bug 30536
Embeds should be defined in a single place
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30536: Refer to parameters enum
Bug-30536-Refer-to-parameters-enum.patch (text/plain), 1.29 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-04-14 16:03:04 UTC
(
hide
)
Description:
Bug 30536: Refer to parameters enum
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-04-14 16:03:04 UTC
Size:
1.29 KB
patch
obsolete
>From ed6194f3b87bf61ac6565d872e44f414ee8238bc Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 14 Apr 2022 12:22:27 +0100 >Subject: [PATCH] Bug 30536: Refer to parameters enum > >This patch updates the stash_embed method to use the parameters hash >enum instead of the top level x-koha-embed custom definition. This way >we can remove the requirement for defining this list twice. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/REST/Plugin/Query.pm | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > >diff --git a/Koha/REST/Plugin/Query.pm b/Koha/REST/Plugin/Query.pm >index 396af699b9..f14fa6fdc9 100644 >--- a/Koha/REST/Plugin/Query.pm >+++ b/Koha/REST/Plugin/Query.pm >@@ -240,7 +240,11 @@ Merges parameters from $q_params into $filtered_params. > > my $spec = $args->{spec} // {}; > >- my $embed_spec = $spec->{'x-koha-embed'}; >+ my $embed_spec; >+ for my $param (@{$spec->{parameters}}) { >+ next unless $param->{name} eq 'x-koha-embed'; >+ $embed_spec = $param->{items}->{enum}; >+ } > my $embed_header = $c->req->headers->header('x-koha-embed'); > > Koha::Exceptions::BadParameter->throw("Embedding objects is not allowed on this endpoint.") >-- >2.34.1
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 30536
:
133303
|
133309
|
133313
|
133314
|
133315
|
133316
|
133324
|
133325
|
133327
|
133328
|
133329
|
133330
|
134479
|
134480
|
134481
|
134482
|
134483
|
134484
|
134506
|
134507
|
134508
|
134509
|
134510
|
134511