Bugzilla – Attachment 42834 Details for
Bug 14656
Delete Bibliographic Records REST API route & permission
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14656 - Delete Bibliographic Records REST API - use C4::Biblio instead :(
Bug-14656---Delete-Bibliographic-Records-REST-API-.patch (text/plain), 1.19 KB, created by
Olli-Antti Kivilahti
on 2015-09-24 07:17:17 UTC
(
hide
)
Description:
Bug 14656 - Delete Bibliographic Records REST API - use C4::Biblio instead :(
Filename:
MIME Type:
Creator:
Olli-Antti Kivilahti
Created:
2015-09-24 07:17:17 UTC
Size:
1.19 KB
patch
obsolete
>From 0a89dfda14405bc5b13c5ce6dc1065f33d7f6e35 Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Thu, 24 Sep 2015 10:16:36 +0300 >Subject: [PATCH] Bug 14656 - Delete Bibliographic Records REST API - use > C4::Biblio instead :( > >--- > Koha/REST/V1/Biblios.pm | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > >diff --git a/Koha/REST/V1/Biblios.pm b/Koha/REST/V1/Biblios.pm >index 8cc125b..30dda9e 100644 >--- a/Koha/REST/V1/Biblios.pm >+++ b/Koha/REST/V1/Biblios.pm >@@ -5,6 +5,7 @@ use Modern::Perl; > use Mojo::Base 'Mojolicious::Controller'; > > use Koha::Database; >+use C4::Biblio; > > sub delete_biblio { > my ($c, $args, $cb) = @_; >@@ -16,12 +17,11 @@ sub delete_biblio { > return $c->$cb({error => "Biblio not found"}, 404); > } > >- my $itemCount = $schema->resultset('Item')->search({biblionumber => $args->{biblionumber}})->count(); >- if ($itemCount) { >- return $c->$cb({error => "Biblio has Items attached. Delete them first."}, 400); >+ my $errors = C4::Biblio::DelBiblio( $args->{biblionumber} ); >+ if ($errors) { >+ return $c->$cb({error => $errors}, 400); > } > >- $biblio->delete(); > return $c->$cb('', 204); > } > >-- >1.9.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 14656
:
41550
|
42115
|
42329
| 42834