Bugzilla – Attachment 135372 Details for
Bug 30822
BatchCommit does not deal with indexation correctly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30822: Clarify that BatchCommitItems is a private function
Bug-30822-Clarify-that-BatchCommitItems-is-a-priva.patch (text/plain), 4.22 KB, created by
Martin Renvoize (ashimema)
on 2022-05-26 12:04:57 UTC
(
hide
)
Description:
Bug 30822: Clarify that BatchCommitItems is a private function
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-05-26 12:04:57 UTC
Size:
4.22 KB
patch
obsolete
>From ada23fff70d78648b201636c99c790c04c2db5eb Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 26 May 2022 13:03:10 +0100 >Subject: [PATCH] Bug 30822: Clarify that BatchCommitItems is a private > function > >BatchCommitItems is only being used within this module and isn't >mentioned in EXPORT_OK. This patch simply renames it to >_batchCommitItems to take the _ standard for private functions and also >adds a little hint to the POD of the function to clarify that the caller >must trigger a re-index. >--- > C4/ImportBatch.pm | 16 +++++++++------- > 1 file changed, 9 insertions(+), 7 deletions(-) > >diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm >index aee25ca549..ddd887e2a6 100644 >--- a/C4/ImportBatch.pm >+++ b/C4/ImportBatch.pm >@@ -632,7 +632,7 @@ sub BatchCommitRecords { > my $marc_record = MARC::Record->new_from_usmarc($rowref->{'marc'}); > > if ($record_type eq 'biblio') { >- # remove any item tags - rely on BatchCommitItems >+ # remove any item tags - rely on _batchCommitItems > ($item_tag,$item_subfield) = &GetMarcFromKohaField( "items.itemnumber" ); > foreach my $item_field ($marc_record->field($item_tag)) { > $marc_record->delete_field($item_field); >@@ -653,7 +653,7 @@ sub BatchCommitRecords { > push @biblio_ids, $recordid; > $query = "UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?"; # FIXME call SetMatchedBiblionumber instead > if ($item_result eq 'create_new' || $item_result eq 'replace') { >- my ($bib_items_added, $bib_items_replaced, $bib_items_errored) = BatchCommitItems($rowref->{'import_record_id'}, $recordid, $item_result); >+ my ($bib_items_added, $bib_items_replaced, $bib_items_errored) = _batchCommitItems($rowref->{'import_record_id'}, $recordid, $item_result); > $num_items_added += $bib_items_added; > $num_items_replaced += $bib_items_replaced; > $num_items_errored += $bib_items_errored; >@@ -702,7 +702,7 @@ sub BatchCommitRecords { > $query = "UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?"; # FIXME call SetMatchedBiblionumber instead > > if ($item_result eq 'create_new' || $item_result eq 'replace') { >- my ($bib_items_added, $bib_items_replaced, $bib_items_errored) = BatchCommitItems($rowref->{'import_record_id'}, $recordid, $item_result); >+ my ($bib_items_added, $bib_items_replaced, $bib_items_errored) = _batchCommitItems($rowref->{'import_record_id'}, $recordid, $item_result); > $num_items_added += $bib_items_added; > $num_items_replaced += $bib_items_replaced; > $num_items_errored += $bib_items_errored; >@@ -725,7 +725,7 @@ sub BatchCommitRecords { > $recordid = $record_match; > $num_ignored++; > if ($record_type eq 'biblio' and defined $recordid and ( $item_result eq 'create_new' || $item_result eq 'replace' ) ) { >- my ($bib_items_added, $bib_items_replaced, $bib_items_errored) = BatchCommitItems($rowref->{'import_record_id'}, $recordid, $item_result); >+ my ($bib_items_added, $bib_items_replaced, $bib_items_errored) = _batchCommitItems($rowref->{'import_record_id'}, $recordid, $item_result); > push @biblio_ids, $recordid if $bib_items_added || $bib_items_replaced; > $num_items_added += $bib_items_added; > $num_items_replaced += $bib_items_replaced; >@@ -750,14 +750,16 @@ sub BatchCommitRecords { > return ($num_added, $num_updated, $num_items_added, $num_items_replaced, $num_items_errored, $num_ignored); > } > >-=head2 BatchCommitItems >+=head2 _batchCommitItems > > ($num_items_added, $num_items_errored) = >- BatchCommitItems($import_record_id, $biblionumber); >+ _batchCommitItems($import_record_id, $biblionumber); >+ >+Private function for batch commiting item changes. We do not trigger a re-index here, that is left to the caller. > > =cut > >-sub BatchCommitItems { >+sub _batchCommitItems { > my ( $import_record_id, $biblionumber, $action ) = @_; > > my $dbh = C4::Context->dbh; >-- >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 30822
:
135251
|
135372
|
135963
|
135964
|
136218
|
136219
|
136247
|
136248