Bugzilla – Attachment 133316 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: Use objects->find in SMTP Servers controller
Bug-30536-Use-objects-find-in-SMTP-Servers-control.patch (text/plain), 1.41 KB, created by
Martin Renvoize
on 2022-04-14 14:17:08 UTC
(
hide
)
Description:
Bug 30536: Use objects->find in SMTP Servers controller
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2022-04-14 14:17:08 UTC
Size:
1.41 KB
patch
obsolete
>From e520b7b9d3b32039b42db84aa85b034287d74394 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 14 Apr 2022 14:09:39 +0100 >Subject: [PATCH] Bug 30536: Use objects->find in SMTP Servers controller > >This patch removes the direct reference to the koha.embed >stashed variable in the SMTP controller and switches us >to the modern objects->find approach. >--- > Koha/REST/V1/Config/SMTP/Servers.pm | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/Koha/REST/V1/Config/SMTP/Servers.pm b/Koha/REST/V1/Config/SMTP/Servers.pm >index 5949c535f4..869ea60204 100644 >--- a/Koha/REST/V1/Config/SMTP/Servers.pm >+++ b/Koha/REST/V1/Config/SMTP/Servers.pm >@@ -59,7 +59,9 @@ sub get { > my $c = shift->openapi->valid_input or return; > > return try { >- my $smtp_server = Koha::SMTP::Servers->find( $c->validation->param('smtp_server_id') ); >+ my $smtp_server_id = $c->validation->param('smtp_server_id'); >+ my $smtp_server = >+ $c->objects->find( Koha::SMTP::Servers->new, $smpt_server_id ); > > unless ($smtp_server) { > return $c->render( >@@ -70,11 +72,9 @@ sub get { > ); > } > >- my $embed = $c->stash('koha.embed'); >- > return $c->render( > status => 200, >- openapi => $smtp_server->to_api({ embed => $embed }) >+ openapi => $smtp_server > ); > } > catch { >-- >2.20.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