Bugzilla – Attachment 150663 Details for
Bug 33262
When an ordered record is deleted, we lose all information on what was ordered
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33262: Store the biblionumber of a deleted record in the order line
Bug-33262-Store-the-biblionumber-of-a-deleted-reco.patch (text/plain), 2.22 KB, created by
Katrin Fischer
on 2023-05-04 13:29:02 UTC
(
hide
)
Description:
Bug 33262: Store the biblionumber of a deleted record in the order line
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-05-04 13:29:02 UTC
Size:
2.22 KB
patch
obsolete
>From 95e384a9ceb9e3c6511897fc6df9c839f872e0df Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer@bsz-bw.de> >Date: Thu, 4 May 2023 12:15:36 +0000 >Subject: [PATCH] Bug 33262: Store the biblionumber of a deleted record in the > order line > >When a bibliographic record is deleted and linked to an order >in the acquisition module, the biblionumber in the order line is >currently deleted as well. This makes it impossible to tell what >was ordered in the first place. This is a big issue for libraries >that need to be able to track how money was spent over long periods >of time. > >With this patch the biblionumber of the deleted record will be moved >to a new column deleted_biblionumber in the order line, keeping the FK >on biblionumber. > >To test: >* Apply patch, run dataase update >* Create a order/basket in the acquisitions module >* Order several things, you can use existing records from the sample data >* Make sure you order one of the records at least twice >* Take a look at the aqorders table in your database, using a report: > > SELECT biblionumber, deleted_biblionumber, ordernumber from aqorders; > >* From the catalog, delete the items on the records and then the records > > Note: There is a warning about attached orders warning about consequences > for acquisitions. I have chosen to keep it at this point in time, as > there are still visible side effects of deleting the record, like bug 10758. > >* Re-run the report and compare results to the first run. deleted_biblionumber > should now be filled with the biblionumber of the deleted record. > biblionumber should be NULL/empty. >--- > C4/Biblio.pm | 4 ++++ > 1 file changed, 4 insertions(+) > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 7a49f47df7..dbb4026816 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -519,6 +519,10 @@ sub DelBiblio { > $hold->cancel({ skip_holds_queue => 1 }); > } > >+ # We update any existing orders >+ my $orders = $biblio->orders; >+ $orders->update({ deleted_biblionumber => $biblionumber}, { no_triggers => 1 }); >+ > unless ( $params->{skip_record_index} ){ > my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); > $indexer->index_records( $biblionumber, "recordDelete", "biblioserver" ); >-- >2.30.2
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 33262
:
150647
|
150657
|
150658
|
150659
|
150660
|
150661
|
150662
|
150663
|
150664
|
150680
|
150681
|
150682
|
150683
|
150684
|
150702
|
150703
|
150704
|
150705
|
150706
|
150734
|
150735
|
150736
|
150737
|
150738