Bugzilla – Attachment 189091 Details for
Bug 17387
Add an undelete feature for items/biblios
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17387: add biblio embed to deleteditems return
Bug-17387-add-biblio-embed-to-deleteditems-return.patch (text/plain), 2.36 KB, created by
Jacob O'Mara
on 2025-11-05 15:39:40 UTC
(
hide
)
Description:
Bug 17387: add biblio embed to deleteditems return
Filename:
MIME Type:
Creator:
Jacob O'Mara
Created:
2025-11-05 15:39:40 UTC
Size:
2.36 KB
patch
obsolete
>From 9bb9568f3cb099242eeb501199886559eb2d8b5d Mon Sep 17 00:00:00 2001 >From: Jacob O'Mara <Jacob.omara@openfifth.co.uk> >Date: Thu, 30 Oct 2025 11:24:56 +0000 >Subject: [PATCH] Bug 17387: add biblio embed to deleteditems return > >--- > Koha/Old/Item.pm | 20 ++++++++++++++++++++ > api/v1/swagger/paths/deleted_items.yaml | 18 ++++++++++++++++++ > 2 files changed, 38 insertions(+) > >diff --git a/Koha/Old/Item.pm b/Koha/Old/Item.pm >index 75991d3f05c..22371b7a09f 100644 >--- a/Koha/Old/Item.pm >+++ b/Koha/Old/Item.pm >@@ -20,8 +20,10 @@ use Modern::Perl; > use base qw(Koha::Object); > > use Koha::Biblio; >+use Koha::Biblios; > use Koha::Exceptions; > use Koha::Item; >+use Koha::Old::Biblios; > use Koha::SearchEngine::Indexer; > > =head1 NAME >@@ -34,6 +36,24 @@ Koha::Old::Item - Koha Old::Item Object class > > =cut > >+=head3 biblio >+ >+ my $biblio = $deleted_item->biblio; >+ >+Returns the Koha::Biblio or Koha::Old::Biblio object for this item, >+checking first in the biblio table and then in deletedbiblio table. >+ >+=cut >+ >+sub biblio { >+ my ($self) = @_; >+ >+ my $biblio = Koha::Biblios->find( $self->biblionumber ); >+ return $biblio if $biblio; >+ >+ return Koha::Old::Biblios->find( $self->biblionumber ); >+} >+ > =head3 restore > > my $item = $deleted_item->restore; >diff --git a/api/v1/swagger/paths/deleted_items.yaml b/api/v1/swagger/paths/deleted_items.yaml >index 31a4d3f9e01..6b108b5a4c0 100644 >--- a/api/v1/swagger/paths/deleted_items.yaml >+++ b/api/v1/swagger/paths/deleted_items.yaml >@@ -14,6 +14,15 @@ > - $ref: "../swagger.yaml#/parameters/q_param" > - $ref: "../swagger.yaml#/parameters/q_body" > - $ref: "../swagger.yaml#/parameters/request_id_header" >+ - name: x-koha-embed >+ in: header >+ required: false >+ description: Embed list sent as a request header >+ type: array >+ items: >+ type: string >+ enum: >+ - biblio > produces: > - application/json > responses: >@@ -61,6 +70,15 @@ > summary: Get deleted item > parameters: > - $ref: "../swagger.yaml#/parameters/item_id_pp" >+ - name: x-koha-embed >+ in: header >+ required: false >+ description: Embed list sent as a request header >+ type: array >+ items: >+ type: string >+ enum: >+ - biblio > produces: > - application/json > responses: >-- >2.39.5
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 17387
:
188670
|
188671
|
188672
|
188673
|
188674
|
188675
|
188676
|
188677
|
188678
|
188679
|
188680
|
188681
|
188682
|
188683
|
188684
|
188685
|
188686
|
188687
|
188688
|
188689
|
188690
|
188691
|
188692
|
188693
|
188694
|
188695
|
188696
|
188697
|
188698
|
188699
|
188700
|
188701
|
188780
|
188781
|
188782
|
188783
|
188784
|
188785
|
188786
|
188787
|
188788
|
188789
|
188790
|
188791
|
188792
|
188793
|
188794
|
188795
|
189046
|
189047
|
189048
|
189049
|
189050
|
189051
|
189052
|
189053
|
189054
|
189055
|
189056
|
189057
|
189058
|
189059
|
189060
|
189061
|
189062
|
189082
|
189083
|
189084
|
189085
|
189086
|
189087
|
189088
|
189089
|
189090
|
189091
|
189092
|
189093
|
189094
|
189095
|
189096
|
189097
|
189098
|
189099
|
189100
|
189101
|
189102
|
189103
|
189104
|
189105
|
189106
|
189107
|
189108
|
189109
|
189110
|
189111
|
189112
|
189113
|
189114
|
189115
|
189116
|
189117
|
189118
|
189119