Bugzilla – Attachment 53922 Details for
Bug 16826
REST API: Add API routes for getting item availability and holdability
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16826: [QA Follow-up] Add 'new_status' to Swagger definition
Bug-16826-QA-Follow-up-Add-newstatus-to-Swagger-de.patch (text/plain), 1.47 KB, created by
Jiri Kozlovsky
on 2016-08-02 18:59:17 UTC
(
hide
)
Description:
Bug 16826: [QA Follow-up] Add 'new_status' to Swagger definition
Filename:
MIME Type:
Creator:
Jiri Kozlovsky
Created:
2016-08-02 18:59:17 UTC
Size:
1.47 KB
patch
obsolete
>From 916e870ea15b812d174c59527ac488e5eec21ee7 Mon Sep 17 00:00:00 2001 >From: Jiri Kozlovsky <mail@jkozlovsky.cz> >Date: Mon, 1 Aug 2016 15:36:05 +0200 >Subject: [PATCH] Bug 16826: [QA Follow-up] Add 'new_status' to Swagger > definition > >Adds missing "new_status" to item's Swagger definition. > >Also, to avoid forgotten columns in definitions, adds a test to >compare item-definition to database's items-table. > >To test: >1. Run t/db_dependent/api/v1/items.t > >Signed-off-by: Jiri Kozlovsky <mail@jkozlovsky.cz> >--- > Koha/REST/V1/Item.pm | 9 +++++++++ > 1 file changed, 9 insertions(+) > >diff --git a/Koha/REST/V1/Item.pm b/Koha/REST/V1/Item.pm >index 03fd333..b51a225 100644 >--- a/Koha/REST/V1/Item.pm >+++ b/Koha/REST/V1/Item.pm >@@ -21,6 +21,7 @@ use Mojo::Base 'Mojolicious::Controller'; > use Mojo::JSON; > > use C4::Auth qw( haspermission ); >+use C4::Items qw( GetHiddenItemnumbers ); > > use Koha::Items; > >@@ -36,6 +37,14 @@ sub get { > # Hide non-public itemnotes if user has no staff access > my $user = $c->stash('koha.user'); > unless ($user && haspermission($user->userid, {catalogue => 1})) { >+ >+ my @hiddenitems = C4::Items::GetHiddenItemnumbers( ({ itemnumber => $itemnumber}) ); >+ my %hiddenitems = map { $_ => 1 } @hiddenitems; >+ >+ # Pretend it was not found as it's hidden from OPAC to regular users >+ return $c->$cb({error => "Item not found"}, 404) >+ if $hiddenitems{$itemnumber}; >+ > $item->set({ itemnotes_nonpublic => undef }); > } > >-- >2.1.4
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 16826
:
53271
|
53276
|
53371
|
53672
|
53675
|
53813
|
53826
|
53827
|
53922
|
54053
|
56128
|
56129
|
56130
|
56295
|
57271
|
57321
|
57369
|
57370
|
57371
|
57373
|
57382
|
58456
|
58457
|
58458
|
60155
|
60156
|
60157
|
60218
|
60219
|
60267
|
60268
|
60269
|
62727