Bugzilla – Attachment 134672 Details for
Bug 30467
BatchDeleteItem task does not deal with indexation correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30467: (QA follow-up) Restore indexing for item only deletion
Bug-30467-QA-follow-up-Restore-indexing-for-item-o.patch (text/plain), 2.18 KB, created by
Martin Renvoize (ashimema)
on 2022-05-06 07:12:10 UTC
(
hide
)
Description:
Bug 30467: (QA follow-up) Restore indexing for item only deletion
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-05-06 07:12:10 UTC
Size:
2.18 KB
patch
obsolete
>From 71c1f6e9bac2c04e4322e3d6f93950006608e602 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 6 May 2022 08:10:04 +0100 >Subject: [PATCH] Bug 30467: (QA follow-up) Restore indexing for item only > deletion > >This patch restores indexing for item only bulk deletions. >--- > Koha/BackgroundJob/BatchDeleteItem.pm | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > >diff --git a/Koha/BackgroundJob/BatchDeleteItem.pm b/Koha/BackgroundJob/BatchDeleteItem.pm >index 49ec850a33..20c9d4510d 100644 >--- a/Koha/BackgroundJob/BatchDeleteItem.pm >+++ b/Koha/BackgroundJob/BatchDeleteItem.pm >@@ -135,16 +135,19 @@ sub process { > } > > # If there are no items left, delete the biblio >- if ( $delete_biblios && @biblionumbers ) { >+ my @updated_biblionumbers; >+ if ( @biblionumbers ) { > for my $biblionumber ( uniq @biblionumbers ) { > my $items_count = > Koha::Biblios->find($biblionumber)->items->count; >- if ( $items_count == 0 ) { >+ if ( $delete_biblios && $items_count == 0 ) { > my $error = C4::Biblio::DelBiblio( $biblionumber, > { skip_record_index => 1 } ); > unless ($error) { > push @deleted_biblionumbers, $biblionumber; > } >+ } else { >+ push @updated_biblionumbers, $biblionumber; > } > } > >@@ -156,6 +159,14 @@ sub process { > 'recordDelete', "biblioserver", undef ); > } > } >+ >+ if (@updated_biblionumbers) { >+ my $indexer = Koha::SearchEngine::Indexer->new( >+ { index => $Koha::SearchEngine::BIBLIOS_INDEX } ); >+ >+ $indexer->index_records( \@deleted_biblionumbers, >+ 'specialUpdate', "biblioserver", undef ); >+ } > } > ); > } >-- >2.20.1
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 30467
:
132992
|
134398
|
134640
|
134672
|
134675
|
134741
|
134744