Bugzilla – Attachment 112401 Details for
Bug 26750
Deleted items are not removed from index
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26750: Deleted items not indexed
Bug-26750-Deleted-items-not-indexed.patch (text/plain), 1.61 KB, created by
Chris Cormack
on 2020-10-24 21:17:51 UTC
(
hide
)
Description:
Bug 26750: Deleted items not indexed
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2020-10-24 21:17:51 UTC
Size:
1.61 KB
patch
obsolete
>From ce38b6a9fec2a5ae6b479d2e1a4c13caaf659760 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Bj=C3=B6rn=20Nyl=C3=A9n?= <bjorn.nylen@ub.lu.se> >Date: Tue, 20 Oct 2020 14:11:16 +0200 >Subject: [PATCH] Bug 26750: Deleted items not indexed > >After deleting an item it is still searchable in the index. Similar to bug 26507 where record is reindexed before the database is changed. > >To test: >1. Delete an item >2. Search the barcode in the main search box. You'll find the original record but wiht hte deleted item missing. >3. Apply patch. >4. Repeat steps 1-2 (with another item). No record should be found. > >Note to test you have to have the indexer running, not the cron job, and it >needs to be running fast so that the index is updated before the delete >takes place > >Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> >--- > Koha/Item.pm | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 5114a87db3..bedf4d1856 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -214,6 +214,8 @@ sub delete { > # FIXME check the item has no current issues > # i.e. raise the appropriate exception > >+ my $result = $self->SUPER::delete; >+ > my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX }); > $indexer->index_records( $self->biblionumber, "specialUpdate", "biblioserver" ) > unless $params->{skip_record_index}; >@@ -223,7 +225,7 @@ sub delete { > logaction( "CATALOGUING", "DELETE", $self->itemnumber, "item" ) > if C4::Context->preference("CataloguingLog"); > >- return $self->SUPER::delete; >+ return $result; > } > > =head3 safe_delete >-- >2.11.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 26750
:
112030
|
112401
|
112435