Bugzilla – Attachment 173493 Details for
Bug 30648
Title is lost in holds history when bibliographic record is deleted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30648: Record deleted_biblionumber in holds
Bug-30648-Record-deletedbiblionumber-in-holds.patch (text/plain), 2.66 KB, created by
Martin Renvoize (ashimema)
on 2024-10-28 10:31:24 UTC
(
hide
)
Description:
Bug 30648: Record deleted_biblionumber in holds
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-10-28 10:31:24 UTC
Size:
2.66 KB
patch
obsolete
>From 515f71890788920409e868ede8f36ef93d185424 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 11 Oct 2024 12:28:48 +0000 >Subject: [PATCH] Bug 30648: Record deleted_biblionumber in holds >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch ensures the deleted biblionumber is recorded in current and previous holds >before the record is deleted > >To test: >1 - Place and fill a few holds on a biblio, completing checkout to patron >2 - Place a few holds on the biblio and do not fulfill them >3 - Delete the items from the biblio via the DB (otherwise you cannot delete last item when there are holds) > DELETE FROM items WHERE biblionumber={biblionumber} >4 - Delete the biblio >5 - Check the DB and confirm the deleted_biblionumber column has been filled > SELECT reserve_id,deleted_biblionumber,biblionumber FROM old_reserves WHERE deleted_biblionumber = {biblionumber}; >6 - Sign off! > >Signed-off-by: Anneli Ãsterman <anneli.osterman@koha-suomi.fi> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Biblio.pm | 3 +++ > Koha/Biblio.pm | 16 ++++++++++++++++ > 2 files changed, 19 insertions(+) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 54055aec2a4..1a88d52bdb9 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -554,6 +554,9 @@ sub DelBiblio { > > # We delete any existing holds > my $holds = $biblio->holds; >+ $holds->update({ deleted_biblionumber => $biblionumber }, { no_triggers => 1 }); >+ my $old_holds = $biblio->old_holds; >+ $old_holds->update({ deleted_biblionumber => $biblionumber }, { no_triggers => 1 }); > while ( my $hold = $holds->next ) { > # no need to update the holds queue on each step, we'll do it at the end > $hold->cancel({ skip_holds_queue => 1 }); >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 67242a33088..59a8fc0bfe6 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -52,6 +52,7 @@ use Koha::Item::Transfer::Limits; > use Koha::Items; > use Koha::Libraries; > use Koha::Old::Checkouts; >+use Koha::Old::Holds; > use Koha::Ratings; > use Koha::Recalls; > use Koha::RecordProcessor; >@@ -715,6 +716,21 @@ sub holds { > return Koha::Holds->_new_from_dbic($hold_rs); > } > >+=head3 old_holds >+ >+my $old_holds = $biblio->old_holds(); >+ >+return the historic holds placed on this record >+ >+=cut >+ >+sub old_holds { >+ my ( $self, $params, $attributes ) = @_; >+ $attributes->{order_by} = 'priority' unless exists $attributes->{order_by}; >+ my $old_hold_rs = $self->_result->old_reserves->search( $params, $attributes ); >+ return Koha::Old::Holds->_new_from_dbic($old_hold_rs); >+} >+ > =head3 current_holds > > my $holds = $biblio->current_holds >-- >2.47.0
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 30648
:
172687
|
172688
|
172689
|
172690
|
172691
|
172692
|
173340
|
173341
|
173342
|
173343
|
173344
|
173345
|
173491
|
173492
| 173493 |
173494
|
173495
|
173496
|
173611