Bugzilla – Attachment 181380 Details for
Bug 38395
Title is not displayed in hold history when bibliographic record is deleted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38395: Display bibliographic data for deleted biblios in holds history
Bug-38395-Display-bibliographic-data-for-deleted-b.patch (text/plain), 8.04 KB, created by
Roman Dolny
on 2025-04-23 14:38:25 UTC
(
hide
)
Description:
Bug 38395: Display bibliographic data for deleted biblios in holds history
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2025-04-23 14:38:25 UTC
Size:
8.04 KB
patch
obsolete
>From 22ea8c1d1d363c49222195d7445a98e2ec383d02 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Wed, 23 Apr 2025 13:44:57 +0000 >Subject: [PATCH] Bug 38395: Display bibliographic data for deleted biblios in > holds history > >This patch adds deleted_biblio to the patron holds api and adjsuts the display to >shwo the data for deleted items > >To test: > - place a hold > - cancel the hold > - look in patron hold history, see the title > - delete the biblio > - reload patron hold history > - you see a line with no title or author > - apply patch, yarn build, restart_all > - reload patron hold history > - success, you see deleted title info > - enable OPACHoldsHistory preference > - sign in to OPAC as patron > - confirm holds history shows deleted title info > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > Koha/Old/Hold.pm | 13 +++++++++++++ > api/v1/swagger/definitions/hold.yaml | 5 +++++ > api/v1/swagger/paths/holds.yaml | 1 + > api/v1/swagger/paths/patrons_holds.yaml | 1 + > .../prog/en/includes/js-biblio-format.inc | 3 +++ > .../prog/en/modules/members/holdshistory.tt | 11 ++++++++--- > .../bootstrap/en/includes/biblio-title.inc | 2 ++ > .../bootstrap/en/modules/opac-holdshistory.tt | 5 +++++ > 8 files changed, 38 insertions(+), 3 deletions(-) > >diff --git a/Koha/Old/Hold.pm b/Koha/Old/Hold.pm >index 8f97163c6e..3d461e82a9 100644 >--- a/Koha/Old/Hold.pm >+++ b/Koha/Old/Hold.pm >@@ -23,6 +23,7 @@ use base qw(Koha::Hold); > > use C4::Context; > use Koha::Exceptions::SysPref; >+use Koha::Old::Biblios; > > =head1 NAME > >@@ -47,6 +48,18 @@ sub biblio { > return Koha::Biblio->_new_from_dbic($rs); > } > >+=head3 deleted_biblio >+ >+Returns the related Koha::Deletedbiblio object for this old hold >+ >+=cut >+ >+sub deleted_biblio { >+ my ($self) = @_; >+ my $db = $self->_result->deleted_biblionumber; >+ return Koha::Old::Biblios->find($db); >+} >+ > =head3 item > > Returns the related Koha::Item object for this old Hold >diff --git a/api/v1/swagger/definitions/hold.yaml b/api/v1/swagger/definitions/hold.yaml >index 48dadf8a5f..810f2647db 100644 >--- a/api/v1/swagger/definitions/hold.yaml >+++ b/api/v1/swagger/definitions/hold.yaml >@@ -120,6 +120,11 @@ properties: > - object > - "null" > description: Bibliographic record >+ deleted_biblio: >+ type: >+ - object >+ - "null" >+ description: Deleted bibliographic record > item: > type: > - object >diff --git a/api/v1/swagger/paths/holds.yaml b/api/v1/swagger/paths/holds.yaml >index a6aff1b75c..cac6627018 100644 >--- a/api/v1/swagger/paths/holds.yaml >+++ b/api/v1/swagger/paths/holds.yaml >@@ -103,6 +103,7 @@ > enum: > - cancellation_requested > - biblio >+ - deleted_biblio > - pickup_library > collectionFormat: csv > produces: >diff --git a/api/v1/swagger/paths/patrons_holds.yaml b/api/v1/swagger/paths/patrons_holds.yaml >index 1915f42734..827cffd8bb 100644 >--- a/api/v1/swagger/paths/patrons_holds.yaml >+++ b/api/v1/swagger/paths/patrons_holds.yaml >@@ -30,6 +30,7 @@ > enum: > - cancellation_requested > - biblio >+ - deleted_biblio > - item > - pickup_library > - pickup_library.branchname >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/js-biblio-format.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/js-biblio-format.inc >index 8a5dfee946..cb1a914ea2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/js-biblio-format.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/js-biblio-format.inc >@@ -19,6 +19,9 @@ > title = escape_str(biblio.biblio_id); > } else { > title = '<span class="biblio-title">'; >+ if ( config && config.deleted ) { >+ title += _("(Bibliographic record deleted) "); >+ } > if (biblio.title != null && biblio.title != "") { > title += escape_str(biblio.title); > } else { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt >index c92931f13d..57d9ff16dd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt >@@ -207,14 +207,18 @@ > url: table_url, > }, > order: [], >- embed: ['biblio', 'item', 'pickup_library', 'pickup_library.branchname'], >+ embed: ['biblio', 'deleted_biblio', 'item', 'pickup_library', 'pickup_library.branchname'], > columns: [ > { > data: "biblio.title:biblio.subtitle:biblio.medium", > searchable: true, > orderable: true, > render: function (data, type, row, meta) { >- return $biblio_to_html(row.biblio, { link: 1 }); >+ if( row.biblio ){ >+ return $biblio_to_html(row.biblio, { link: 1 }); >+ } else { >+ return $biblio_to_html(row.deleted_biblio, { link: 0, deleted: 1 }); >+ } > } > }, > { >@@ -222,7 +226,8 @@ > searchable: true, > orderable: true, > render: function (data, type, row, meta) { >- return row.biblio ? row.biblio.author : "" ; >+ let biblio = row.biblio ? row.biblio : row.deleted_biblio; >+ return biblio ? biblio.author : ""; > } > }, > { >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/biblio-title.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/biblio-title.inc >index b98c02b909..d37640599f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/biblio-title.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/biblio-title.inc >@@ -1,6 +1,8 @@ > [%- IF link && ! biblio %][% link = 0 %][% END %] > [%- IF ( link ) -%] > <a href="[%- PROCESS biblio_a_href biblionumber => biblio.biblionumber -%]" class="title">[% PROCESS 'show-biblio-title' %]</a> >+[%- ELSIF (deleted) -%] >+ <span class="deleted-biblio">(Deleted bibliographic record) [%- PROCESS 'show-biblio-title' -%]</span> > [%- ELSE -%] > [%- PROCESS 'show-biblio-title' -%] > [%- END -%] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdshistory.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdshistory.tt >index 2ee1960b2f..b0c6e36436 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdshistory.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdshistory.tt >@@ -107,8 +107,13 @@ > <tbody> > [% FOREACH hold IN holds %] > <tr> >+ [% IF hold.biblio %] > <td>[% INCLUDE 'biblio-title.inc' biblio=hold.biblio link=>1 %]</td> > <td>[% hold.biblio.author | html %]</td> >+ [% ELSE %] >+ <td>[% INCLUDE 'biblio-title.inc' biblio=hold.deleted_biblio link=>0 deleted=>1 %]</td> >+ <td>[% hold.deleted_biblio.author | html %]</td> >+ [% END %] > <td>[% hold.item.barcode | html %]</td> > <td>[% Branches.GetName( hold.branchcode ) | html %]</td> > <td data-order="[% hold.reservedate | html %]">[% hold.reservedate | $KohaDates %]</td> >-- >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 38395
:
181373
|
181380
|
181388
|
181397
|
181824
|
181825