Bugzilla – Attachment 133315 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 Cashups controller
Bug-30536-Use-objects-find-in-Cashups-controller.patch (text/plain), 1.44 KB, created by
Martin Renvoize
on 2022-04-14 14:17:04 UTC
(
hide
)
Description:
Bug 30536: Use objects->find in Cashups controller
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2022-04-14 14:17:04 UTC
Size:
1.44 KB
patch
obsolete
>From 2f9d2f729b588f027a11ee7a6f3efb0a5fabd5a9 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 14 Apr 2022 14:06:43 +0100 >Subject: [PATCH] Bug 30536: Use objects->find in Cashups controller > >This patch removes the direct reference to the koha.embed stashed >variable in the Cashups controller and switches us to the modern >objects->find approach. >--- > Koha/REST/V1/CashRegisters/Cashups.pm | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/Koha/REST/V1/CashRegisters/Cashups.pm b/Koha/REST/V1/CashRegisters/Cashups.pm >index 12b6f30214..c6e4b2fcbb 100644 >--- a/Koha/REST/V1/CashRegisters/Cashups.pm >+++ b/Koha/REST/V1/CashRegisters/Cashups.pm >@@ -75,8 +75,9 @@ sub get { > my $c = shift->openapi->valid_input or return; > > return try { >- my $cashup = Koha::Cash::Register::Cashups->find( >- $c->validation->param('cashup_id') ); >+ my $cashup_id = $c->validation->param('cashup_id'); >+ my $cashup = >+ $c->objects->find( Koha::Cash::Register::Cashups->new, $cashup_id ); > unless ($cashup) { > return $c->render( > status => 404, >@@ -84,10 +85,9 @@ sub get { > ); > } > >- my $embed = $c->stash('koha.embed'); > return $c->render( > status => 200, >- openapi => $cashup->to_api( { embed => $embed } ) >+ openapi => $cashup > ); > } > 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